[AccessD] Form label not refreshing

Kaup, Chester Chester_Kaup at kindermorgan.com
Wed Sep 7 14:00:51 CDT 2016


I have a module that opens a form and runs some queries. After each query runs the label on the form is supposed to refresh and display. The code refreshes the form if I step through it but not if I run it . I put some sleep statements in which work when stepping through the code but not when running it. Is my strategy flawed? Below is part of the code. Thanks for any ideas.

Option Compare Database
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Function A()
    Call Active_Well_Counts_by_Project_Area
End Function
'------------------------------------------------------------
' mdl Active_Well_Counts_by_Project_Area
'
'------------------------------------------------------------
Sub Active_Well_Counts_by_Project_Area()


Dim frmMessage As Form
DoCmd.OpenForm "frm Message Form 1"
Set frmMessage = Forms("frm Message Form 1")


On Error GoTo Active_Well_Counts_by_Project_Area_Err

    DoCmd.SetWarnings False
    DoCmd.OpenQuery "qry Status First Day of Prior Month", acViewNormal, acEdit
    frmMessage.ProgressMessage.Caption = "Getting Well Statuses during Month"                           'This one works
    DoCmd.OpenQuery "qry Statuses During Prior Month", acViewNormal, acEdit
    frmMessage.ProgressMessage.Caption = "Getting Active Injectors List Prior Month"                  'blows by this
    Sleep 10000
    DoCmd.OpenQuery "qry Active Injectors List Prior Month", acViewNormal, acEdit
    frmMessage.ProgressMessage.Caption = "Getting Active Producers List Prior Month"
    Sleep 10000



More information about the AccessD mailing list