Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pause processing in a macro

Status
Not open for further replies.

kkitt

Programmer
Dec 1, 2002
122
US
Is there any way to have the steps in a macro wait untill the previous step has finished processing.

I have a macro that
1. opens a table for the user to input the date range for this run.
2. The I want to execute som VBA code that takes these datea and appends a temp table all the dates in this range (other information also).
3. Then runs a query to process this inforamtion and append to another table.

How do i keep the other steps from immediatly execution?


Thanks,
 
I would suggest converting the macro to code, you have more control.

The following is what I use to pause code when it is needed:

PauseTime = 1
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop

PauseTime is the number of seconds you want to pause the code.

This may not solve your problem, but thought I would throw it out there.
 
The issue is that once the table is open they need to edit the dates in it before the rest can run. Putting a delay loop in code is not an option since I do not know how long they will take to input the dates. Could be one data or multiple dates

Thanks anyway.
 
How about using a form instead of a table? Base the form on whatever the table is, and set the Modal property to Yes, or open the form in Dialog mode in your macro. Perhaps a Continue and Cancel button, where Continue executes your code before closing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top