Problem getting time to display right in combobox

M

Max Moor

Hi All,
I have a combobox for users to select a time. I want the time in the
list rows and the box to display like "12:45 AM" or "1:45 PM". The row
source is a table with all the times from midnight to midnght, at 15 minute
resolution.

In the combobox's RowSource query I used:

Expr1: Format([TimeOfDaySelect],"h:nn AM/PM")

For the combobox's Format property, I have:

h:nn AM/PM

For the combobox's InputMask, I have:

99:00\ >LL;;_


Things are very close to what I want, but... I want users to be able
to enter any time in the box, so they get more than 15 minutes resolution
in their data entry. When I click on the box to edit a time, the
placeholder character shows up in a non-sensical place.

For example, I may select "1:45 PM" from the list. When I click there
to edit it, it becomes "1_:45 PM". I thought I could fix it by removing
one of the 9's from the InputMask, but then a two digit hour isn't allowed.

Can I get rid of the placeholder? Is there a better way to do all
this?

Regards,
Max
 
R

Rick Brandt

Max Moor said:
Hi All,
I have a combobox for users to select a time. I want the time in the
list rows and the box to display like "12:45 AM" or "1:45 PM". The row
source is a table with all the times from midnight to midnght, at 15 minute
resolution.

In the combobox's RowSource query I used:

Expr1: Format([TimeOfDaySelect],"h:nn AM/PM")

For the combobox's Format property, I have:

h:nn AM/PM

For the combobox's InputMask, I have:

99:00\ >LL;;_


Things are very close to what I want, but... I want users to be able
to enter any time in the box, so they get more than 15 minutes resolution
in their data entry. When I click on the box to edit a time, the
placeholder character shows up in a non-sensical place.

For example, I may select "1:45 PM" from the list. When I click there
to edit it, it becomes "1_:45 PM". I thought I could fix it by removing
one of the 9's from the InputMask, but then a two digit hour isn't allowed.

Can I get rid of the placeholder? Is there a better way to do all
this?

InputMasks are evil. Get rid of it as how a date looks and how it is stored has
nothing to do with how it is entered anyway.
 

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