How do I keep track of which query is running?

Seti

Well-known Member
Joined
May 19, 2002
Messages
2,916
I have a macro that runs a couple dozen queries. It takes about 30 minutes to run. I'd really like to have the status bar updated periodically showing me some info on where I am in the macro. If not the status bar, I'd settle for a dialog box. I don't need anything fancy, just some way to keep track of where I am.

I can live with code that I need to manually put a message or text into and that I would need to call between each query if need be. I am very flexible on this. Any and all suggestions would be greatly appreciated. Thanks so much.

Access 2000/Win 2K.

Seti
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi Seti,

That's a cool idea. Here's one idea. You could have a form pop up when the user initiates the macro. Put nothing but a listbox on the form and two buttons. Turn all the navigation, record selector, scroll bars etc. Then add something like this to the form load event:
Code:
private sub form_load()
Listbox.RowSourceType = "Value List"
end sub

Then make one button a start macro button and have it initialize your macro, but put in the code, after every SQL expression you run, something to the effect of
Code:
sub macro1
lbstrint = "Query Initialized, please wait..." & Now() & ";"
Listbox.rowsource = lbstring
SQL1
lbstring = lbstring & "Query 1 completed: " & now() & ";"
Listbox.rowsource = lbstring
SQL2
lbstring = lbstring & "Query 2 completed: " & now() & ";"
Listbox.rowsource = lbstring
SQL3
lbstring = lbstring & "Query 3 completed: " & now() & ";"
Listbox.rowsource = lbstring
end sub

and so on. You'll have to adjust the reference to your listbox to be absolute, since you will most likely need to initialize it from a module, unless you insert the macro into the form's code.

HTH,

Then in the macro who progress you want to moniter
 
Upvote 0
Thanks for the quick reply. I am in a slightly different place than I may have implied. This macro is run from the "macro window". I am not using forms, just plain vanilla Access.
 
Upvote 0
I know nothing about Access's macro builder. Sorry :(

Though you could still use my method with the builder, I just don't know how. The idea is, after every query, you add one more item to the listbox rowsource with that item being a statement that says your done with Query X.

I understand you are not using forms. My suggestion was to use one.

-Corticus
 
Upvote 0

Forum statistics

Threads
1,221,525
Messages
6,160,327
Members
451,637
Latest member
hvp2262

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top