Preserving Leading Zero: Military Time - Please HELP! :)

floridaboy2004

New Member
Joined
Nov 17, 2004
Messages
44
I have a field on a form to enter in a "Time of Purchase"

I need for the time to display on the form AND in the underlying table in 'military time' and I do NOT want to enter AM/PM after inputting the time.

Could someone specify how and where to type something that will display 02:00 (~2a.m.) as '02:00" in BOTH the form AND the linked table?

TABLE: CUSTOMER DATA
FORM: CUSTOMER
FIELD: PURCHTIME
*I have been using 'Short Time' but to no avail...

The time in the form and the table repeatedly DROPS the leading '0' (zero) and even though I type in '02:00,' it stores it on the form and table as '2:00' and loses the leading '0' (zero).

Thank-you in advance for your time and efforts! :)
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi,

try setting the format to "Short Time" in both the table and the form AND setting the input mask to "00:00" (without the quotes) in both the table and the form.

HTH, Andrew. :)
 
Upvote 0
Hello andrew,

Thanks for the reply...this does NOT work for me (still). :( Is there something else that may be causing the '0' (zero) to drop?

I have the table set to 'Date/Time' with the specs you suggested, as well as the form. Would the 'decimal' field impact this? What else could be causing it to drop as far as properties/fields go (such as 'AutoCorrect', etc. or other suspect fields to check)?

Thanks for the suggestions! :)

-FB
 
Upvote 0
There are 2 ways to accomplish this, depending on what you need to do. If you just need to display the time in that format on a form or in a report, you can do =format([your time field],"hh:nn"). If you need the time to actually appear this way in a table field or in a bound (updateable) form or query field, you need to change this in your Regional Options in your Control Panel. On the Time tab, change your Time Format to hh:mm:ss tt.

TD
 
Upvote 0

Forum statistics

Threads
1,221,831
Messages
6,162,250
Members
451,757
Latest member
iours

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top