display query running in status bar

  • Thread starter Thread starter Ted
  • Start date Start date
T

Ted

hi all, is there a way to display the name of the query that is running in
the status bar?

i have code executing that has a bunch of queries running and i'd like to
see which query is running.

TIA
Ted
 
application.SysCmd acSysCmdSetStatus, "MyQueryName"

Be sure to reset the status bar text when done
application.SysCmd acSysCmdSetStatus, " "
(Note: space, not "")
 
Thanks George, is there a way to use a generic piece of code instead of
using "MyQueryName"
i have about 50 queries running and would rather copy and paste something
like

application.SysCmd acSysCmdSetStatus, activeQuery

i tried Application.CurrentObjectName but it only returned the name of the
form that holds the code that runs the queries thru the OpenQuery method.
 
In order to have 50 queries run, you must be calling each query by name. How
are you doing that?
 
Hi Doug,

I'm running them using the OpenQuery Method...

DoCmd.OpenQuery "qryPropertyBIExtraExpenseCovGroup1", acNormal, acEdit
DoCmd.OpenQuery "qryPropertyBIExtraExpenseCovGroup1_CA", acNormal,
acEdit
DoCmd.OpenQuery "qryPropertyBIExtraExpenseCovGroup1_NE", acNormal,
acEdit
DoCmd.OpenQuery "qryPropertyBIExtraExpenseCovGroup1_SE", acNormal,
acEdit
DoCmd.OpenQuery "qryPropertyBIExtraExpenseCovGroup1_WA", acNormal,
acEdit

Do I have to copy and paste application.SysCmd acSysCmdSetStatus,
"MyQueryName"
after each line? Its not mandatory but it takes a while to run and I'd like
to be able to see
where I'm at while its running.
 
'**********
For i = 1 to 50
Select Case i
Case 1
strQueryName = "qryPropertyBIExtraExpenseCovGroup1"
Case 2
strQueryName = "qryPropertyBIExtraExpenseCovGroup1_CA"
'etc

Case 50
strQueryName = "qryPropertyBIExtraExpenseCovGroup1_XYZ"
Case Else
'Optional error message
End Select
Application.SysCmd acSysCmdSetStatus, "Running query " & i & " of 50: "
& strQueryName
Do Events
DoCmd.OpenQuery strQueryName, acNormal, acEdit
Next i
Application.SysCmd acSysCmdSetStatus, " "
'***********
DoEvents might or might not be necessary to let the screen catch up. Won't
hurt.
 
Back
Top