M
Michael
Hi Folks - I am using a Do While Loop to display the running time in a text
box. I would like to have a command button that stops the procedure. What
code do I need to stop a running procedure elegantly? I do not need to
calculate elapsed time. Thanks.
Mike
Here's the code:
Private Sub cmdUntilLoop_Click()
Dim intPause As Integer
Dim dblstart As Double
txtResults.SetFocus
intPause = Val(InputBox("Count how many seconds?", "Timer"))
dblstart = Timer
MsgBox Timer
Do Until Timer > (dblstart + intPause)
'if txtresults is not current time, then display current time
If txtResults.Text <> Format(Now, "Long Time") Then
txtResults.Text = Format(Now, "Long Time")
End If
Loop
End Sub
box. I would like to have a command button that stops the procedure. What
code do I need to stop a running procedure elegantly? I do not need to
calculate elapsed time. Thanks.
Mike
Here's the code:
Private Sub cmdUntilLoop_Click()
Dim intPause As Integer
Dim dblstart As Double
txtResults.SetFocus
intPause = Val(InputBox("Count how many seconds?", "Timer"))
dblstart = Timer
MsgBox Timer
Do Until Timer > (dblstart + intPause)
'if txtresults is not current time, then display current time
If txtResults.Text <> Format(Now, "Long Time") Then
txtResults.Text = Format(Now, "Long Time")
End If
Loop
End Sub