timer control

  • Thread starter Thread starter Gurpreet
  • Start date Start date
G

Gurpreet

how do i use timer control.... i am making an online examination system.....
how can i set timer such that it quits after 2hrs.
 
Gurpreet said:
how do i use timer control.... i am making an online examination system.....
how can i set timer such that it quits after 2hrs.

dim dtTimeStop as date '---Access stores times as a fraction of a
day...
dtTimeStop = DateAdd("h",2,Now)

in your timer control, you'd check for something like

Sub MyForm_OnTimer()
If dtTimeStop<=Now Then
'---put your closing code here
msgbox "Time's up", vbOKonly+vbinfo
End if
....
End Sub
 
Back
Top