Looping

Mcgrco

Registered User.
Local time
Today, 18:21
Joined
Jun 19, 2001
Messages
118
Hi,

Im trying to write a simple procedure that i ac kick off of an evening and the process will start at a designated time.
Ive put in a simple loop that will run untill a certain time and then show a message. When i have it working I will incorporate it into the full procedure.

unfortunatly the loop seems to stick.

the code im usuing is :
Function ChkFirstWhile()

Dim CurrentTime, StartTime


StartTime = "11:45:21"
CurrentTime = Time

Do Until CurrentTime = StartTime

Loop
MsgBox "The time is " & Time
End Function

Can anyone show me where Im going wrong.

thanks
 
Try the following:

Function ChkFirstWhile()

Dim CurrentTime, StartTime


StartTime = "11:45:21"
CurrentTime = Time

Do Until CurrentTime = StartTime
CurrentTime = Time
Loop
MsgBox "The time is " & Time
End Function

HTH
SteveA
 
thanks but that still gets stuck.

I got it to work using

Function CmdSetTheTimer()

Dim StartTime

'Timer events
StartTime = "08:30"
Do Until Format(Time, "short Time") = StartTime
If Format(Time, "short Time") = StartTime Then Exit Do
Loop

MsgBox "The time is " & Time
End Function


Im not sure if this is the correct method but it works
 

Users who are viewing this thread

Back
Top Bottom