Time Format

G

Guest

I want to display my Time in a format of hh:mm on my form. Whenever I
attempt this format, the format property reverts to short time which leaves
off the leading zero. Is there a formate string that will force the leading
zero to be displayed?

The control is used as an offset based on another time field. I change
these times regularly and I am used to selecting just the digit that I want
to change but with a h:mm time in the control, changing the minutes only
results in an error message forcing me to select everything in the control
and entering all 4 characters.
 
J

John W. Vinson

I want to display my Time in a format of hh:mm on my form. Whenever I
attempt this format, the format property reverts to short time which leaves
off the leading zero. Is there a formate string that will force the leading
zero to be displayed?

The control is used as an offset based on another time field. I change
these times regularly and I am used to selecting just the digit that I want
to change but with a h:mm time in the control, changing the minutes only
results in an error message forcing me to select everything in the control
and entering all 4 characters.

Date/Time fields are really designed to store specific points in time. They
have all sorts of problems when you try to use them for offsets or durations
(just for example, 25:30 will NOT be recognized as a time duration, except
perhaps as 25 minutes 30 seconds!)

You might want to consider storing your time offsets in Integer minutes; you
can use two unbound textboxes for hours and minutes, and calculate the offset
on the fly, and parse out 375 into 6 hours and 15 minutes using code in the
form's Current event.

John W. Vinson [MVP]
 
G

Guest

Thanks for your help.

The problem I was having was that I had used an input mask that was messing
me up. Once I took that out, the problem was solved.
 

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

Similar Threads


Top