set a timer

  • Thread starter Thread starter bijan
  • Start date Start date
B

bijan

Hi All
I have a procedure that connect to a database and gets data in a several
steps .and it is necessary to show the name of each steps to user( in
label1.capation) in a user form,It works fast and user just can see the last
step name , how can I control the showing of them in two or more seconds?
My procedure like this:
dim SQL1 as string
dim SQL2 as string
connection string .....
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
STEP ONE
label1.caption="STEP ONE"
SQL1=(my sql statment is here)
:
:
Range("A5").CopyFromRecordset rs
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
STEP TWO
label1.caption="STEP TWO"
SQL2=(my sql statment is here)
:
:
Range("A10").CopyFromRecordset rs
:
:
rs.Close
conn.Close

Thanks in advanced
 
Hi Bob,
Not yet, But If there is not any way to show steps , I will be glad to tell
me how to set a interval timer for each steps.
 
Hi,

Use the Wait Method:

This example pauses a running macro until 6:23 P.M. today.

Application.Wait "18:23:00"

This example pauses a running macro for approximately 10 seconds.

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

This example displays a message indicating whether 10 seconds have passed.

If Application.Wait(Now + TimeValue("0:00:10")) Then
MsgBox "Time expired"
End If
 
Back
Top