Format function question

hbrems

has no clue...
Local time
Today, 21:02
Joined
Nov 2, 2006
Messages
181
Hello,

I'm trying to separate a given time in hours & minutes.

Let's say for example that I've worked 7 hours and 30 minutes. Therefore text box txtworked = 07:30.

vtimeworked = txtworked
vhrs = Format(vtimeworked, "hh") 'results in 07 = ok
vmin = Format(vtimeworked, "mm") 'should be 30 but instead I'm getting 12

My question, why do I keep getting 12 as a value and how can I fix it.

Kind regards,
Hans
 
change the textbox format to general date just to have a look what is really in there. - i bet you are retrieving 12 as the month - not sure how you force the minutes though
 
My text box is in short time format. Somehow I was thinking about the month aswell, but we are still november so he should give me 11 then.
 
Try to format the time with "nn" to avoid getting the month.
For more info do a search for "format date/time" in the access help.
 
Thanks mate, that's the answer to my problem!! :)
 

Users who are viewing this thread

Back
Top Bottom