StopWatch

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi guys
I'm creating a form and the user will have a limit of 10 minutes till fill
in the form. May be, there is someone how has a little module or something
else which display the time /time left in a form?
 
Kent,

1. Place a Label control at the top of the form somewhere. Call it
lblTimeRemaining. Set its Caption property equal to a single space
(otherwise it'll disappear as soon as it loses focus).

2. In the form's Load event, set the form's TimerInterval = 60000, like so:
Me.TimerInterval = 60000 'This is 60 seconds (1 minute).

3. Add the following to the form's Timer event:
Static iCount As Integer
If iCount < 10 Then '60 seconds * 10 = 10 minutes
iCount = iCount + 1
Me!lblTimeRemaining.Caption = Cstr(10 - iCount) & " minutes
remaining."
Else
iCount = 0
Me.TimerInterval = 0
Me!lblTimeRemaining.Caption = "Time's up!"
'Do whatever else you want now.
End If

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Back
Top