Home Privacy Policy Feedback Link to us Site Map

Access: Define a custom format for a Date/Time field on a form in Access 2003/XP/2000/97


Question:  In 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


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


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


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