Link to home
Start Free TrialLog in
Avatar of jad0083
jad0083

asked on

Textbox time input autocomplete, possible?

I have a textbox with this input mask: 99:00\ >LL;0;_, its basically "##:## AM/PM".  I was wondering if it's possible to have that textbox autocomplete when for example someone enters a military time (ex. 23:00), when he tabs out of that text box, it defaults to 11:00 PM, is it possible for an unbound textbox in Access? Thanks!
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you make the format of the text box Medium time, then so long as the user enters a 'valid' time, something less than 23:59, it will get converted to the correct am/pm value.  In your case I tested with 23:00 and it converted it to 11:00 PM
"If you make the format of the text box Medium time,"

Well, except that Medium Time is going to depend on the medium time setting in Windows Regional and Language settings ...

mx
Not quite.  I've got my regional set to the 24 hour clock.  When I select a named time format like Medium it gives the 12 am/pm setting. Both Long and Short times provide the 24 hour clock.  I've just tested and Medium time always give the 12 hr am/pm format regardless of the regional settings.
mx:  BTW there is no Medium time in my Regional and Language settings...  I was giving a solution that did not require code.  However, the customer is always right ;-)
"BTW there is no Medium time in my Regional and Language settings."

Yes, but ... selecting Medium Time in the text box Format ... the displayed result is still impacted by the 'Time Format' in Regional and Language settings ... is what I meant to say ... I misspoke and said 'Medium Time' setting.

mx