G
Guest
I have 2 labels on my form that I want to update with the "current process"
and the time it started. The "current process" relates to the query the
macro is currently running.
Once I click the button to start the macro, only the "Running Query 3"
message is displayed. Once I click the "OK" button on the msgbox, then the
labels are cleared as expected. What I haven't been able to do is display
the "Running Query 1" and "Running Query 2" messages. Following is the code
I use:
Sub Clear_Tables()
Dim QueryName As String
Dim vCurrTime As Date
SysCmd acSysCmdClearStatus
Forms![Invoice]![Label1].Caption = ""
Forms![Invoice]![Label2].Caption = ""
vCurrTime = Time
Forms![Invoice]![Label1].Caption = "Running Query 1"
Forms![Invoice]![Label2].Caption = vCurrTime
QueryName = "Query 1"
DoCmd.OpenQuery QueryName
vCurrTime = Time
Forms![Invoice]![Label1].Caption = "Running Query 2"
Forms![Invoice]![Label2].Caption = vCurrTime
QueryName = "Query 2"
DoCmd.OpenQuery QueryName
vCurrTime = Time
Forms![Invoice]![Label1].Caption = "Running Query 3"
Forms![Invoice]![Label2].Caption = vCurrTime
QueryName = "Query 3"
DoCmd.OpenQuery QueryName
MsgString = "The data tables have been cleared. Import the data now."
MsgBox MsgString, , "Tables Cleared"
Forms![Invoice]![Label1].Caption = ""
Forms![Invoice]![Label2].Caption = ""
End Sub
Any suggestions on how I can get all of the messages to display would be
appreciated. I've tried using messages on the status bar but that isn't
working because the messages are being replaced by the progress bar when some
of the queries are running. I've also tried adding the "sleep" command at
various places but the results are the same........Thanks.....
and the time it started. The "current process" relates to the query the
macro is currently running.
Once I click the button to start the macro, only the "Running Query 3"
message is displayed. Once I click the "OK" button on the msgbox, then the
labels are cleared as expected. What I haven't been able to do is display
the "Running Query 1" and "Running Query 2" messages. Following is the code
I use:
Sub Clear_Tables()
Dim QueryName As String
Dim vCurrTime As Date
SysCmd acSysCmdClearStatus
Forms![Invoice]![Label1].Caption = ""
Forms![Invoice]![Label2].Caption = ""
vCurrTime = Time
Forms![Invoice]![Label1].Caption = "Running Query 1"
Forms![Invoice]![Label2].Caption = vCurrTime
QueryName = "Query 1"
DoCmd.OpenQuery QueryName
vCurrTime = Time
Forms![Invoice]![Label1].Caption = "Running Query 2"
Forms![Invoice]![Label2].Caption = vCurrTime
QueryName = "Query 2"
DoCmd.OpenQuery QueryName
vCurrTime = Time
Forms![Invoice]![Label1].Caption = "Running Query 3"
Forms![Invoice]![Label2].Caption = vCurrTime
QueryName = "Query 3"
DoCmd.OpenQuery QueryName
MsgString = "The data tables have been cleared. Import the data now."
MsgBox MsgString, , "Tables Cleared"
Forms![Invoice]![Label1].Caption = ""
Forms![Invoice]![Label2].Caption = ""
End Sub
Any suggestions on how I can get all of the messages to display would be
appreciated. I've tried using messages on the status bar but that isn't
working because the messages are being replaced by the progress bar when some
of the queries are running. I've also tried adding the "sleep" command at
various places but the results are the same........Thanks.....