O
OlszanskiA
I am trying to set up a simple form where I click a button and 1 hour later
it tells me time is up. I copied the code from MS Access VB help, but I get
the error message regarding the line Start = Timer: "Compile Error: Expected
Variable or Procedure, not Project"
Can you assit me. I've tried may different ways to no avail.
________________________
The code:
Private Sub Alarm_Click()
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
End Sub
it tells me time is up. I copied the code from MS Access VB help, but I get
the error message regarding the line Start = Timer: "Compile Error: Expected
Variable or Procedure, not Project"
Can you assit me. I've tried may different ways to no avail.
________________________
The code:
Private Sub Alarm_Click()
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
End Sub