[AccessD] Form label not refreshing

Heenan, Lambert Lambert.Heenan at aig.com
Wed Sep 7 14:03:51 CDT 2016


Try a DoEvents after each frmMessage.ProgressMessage.Caption = "" line.


Lambert  

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester
Sent: Wednesday, September 07, 2016 3:01 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Form label not refreshing

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

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list