totn Access

MS Access 2003: Define a custom format for a Date/Time field on a form

This MSAccess tutorial explains how to define a custom format for a date/time field on a form in Access 2003 (with screenshots and step-by-step instructions).

Question: In Microsoft Access 2003/XP/2000/97, how can I define a custom format for a Date/Time field on a form? I want to display the date as "01-JAN-2005 21:00:00", even when I move the cursor to another field.

Answer: In Access, you can use the Format property to customize how a date will appear in a form.

For example, if you wanted to view the date as "01-JAN-2005 21:00:00", you could enter the following into the Format property on your text box:

dd-mmm-yyyy h:nn:ss

Microsoft Access

Then when you viewed the form, the text box would display the date as follows:

Microsoft Access

If you wanted to view the date as "01-JAN-2005 9:00:00 PM", you could enter the following into the Format property on your text box:

dd-mmm-yyyy h:nn:ss AM/PM

Microsoft Access

Then when you viewed the form, the text box would display the date as follows:

Microsoft Access