display time remaining on the form

obeylele

Registered User.
Local time
Today, 19:09
Joined
Jul 29, 2005
Messages
28
i want to display time remainig on my quiz form
say quiz has a total time of 15 mins
so i want to show the time on my form
so the user know how much time he/she got

i did search th eforums but couldnt find any
sorry if it is here already
if it is can some on epint it for me
thanks in advance
 
I would think something along the lines of, when the start time is established, calculate the finish time. Store the finish time in a global variable. Have a timer control on the form that refreshes say every 5 seconds, and calculates the difference between the current time and the finish time (global variable) and refreshes the value.
Just mu thoughts.
 
yes this is what ihad in mind
but unfortunately i am ahving hard time calculating
with itmes
first Time function doesnt see to work
if you could show me synatx

hr = Hour(Time)
min = Minute(Time)
sec = Second(Time)
startTime = Time + 15 ' add 15 minutes

this is what i am doing no luck so far
MsgBox "Time: " & hr & ":" & min & ":" & sec

THIS IS COMING AS tIME 0:0:0
 
Have you looked at the DATEDIFF function?
 
thanks to ghudson the problem is solved

but i settled for showing time starting from 0:00 to the time i want the quiz to end by using datediff of start time and now()

not as a count down as i was trying before. And i think in this case it is better tho show time this way.

But i would like to know how i can add say 30 minutes to the
time i get from now() function, should i get the hour minute second
seperately from the date and do my calculations or is there an easy way,
 
Time is a fractional part of a day, so a minute is (1/24/60)
startTime = Time + (15/24/60)' add 15 minutes

HTH

Peter
 
Bat17 said:
Time is a fractional part of a day, so a minute is (1/24/60)
startTime = Time + (15/24/60)' add 15 minutes

HTH

Peter

so how do i add this function into the code?
 

Users who are viewing this thread

Back
Top Bottom