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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top