Help Needed with Printing Reports from Form

T

Terry DeJournett

I have a form that has a command button on it. I have code attached that
runs query #1 and then sends report #1 to printer #1. It then runs a second
query (query #2) and then sends report #2 to printer #2. (Both reports
based on the queries).

Does anyone know if it is possible to put a delay of say 1 minute between
the printing of these two reports? In other words run the first query and
print the first report, then wait for 1 or 2 minutes before running the
second query.

Thanks to all in advance.

T
 
T

Terry DeJournett

I thought it was the timer event, but I am just unsure how to use it in my
case.

T
 
S

SusanV

Hi Terry,

Not the timer *event*, the timer *function. From VBA Help:

Timer Function Example
This example uses the Timer function to pause the application. The example
also uses DoEvents to yield to other processes during the pause.

Dim PauseTime, Start, Finish, TotalTime
If (MsgBox("Press Yes to pause for 5 seconds", 4)) = vbYes Then
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
Finish = Timer ' Set end time.
TotalTime = Finish - Start ' Calculate total time.
MsgBox "Paused for " & TotalTime & " seconds"
Else
End
End If
-- hth,SusanV
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top