Access Custom Date Formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using MSA 2003, and am trying to format dates in my tables/queries in
the following format:

ddd","mmm dd","yyyy

The results that I am looking for are, for example, SUN, Feb 12, 2006.

I tried going to the input mask wizard, and creating the mask as above,
changing from text to date, and using _ as a placeholder. However, when I get
to the display box, it inserts the input mask and won't let me type a value,
nor will it let me save the record mask because of that field.
Am I doing something wrong? Or is there a "glitch" that needs to be
corrected? I did notice that un like previous versions of Access when I go
into the mask wizard to create a new mask, there is no button to click for
"New" or "Edit". It doesn't even show the default stored values. Could I have
something missing in my controls?
Thanks
 
There are 2 aspects of your question:
- how to display the date
- how to input the date.

You could display the date as you requested just by setting the Format
property of the text box the way you suggested. Of course, internally,
Access stores a date/time value as a real number, and just applies the
formatting at display time. Any attempt to use an input mask to force users
to follow that layout when inputting the number would probably be
unsuccessful, and certainly be very frustrating and error-prone.

Can I suggest you use two text boxes side-by-side, for displaying this date?
Change the Format of your existing text box to:
Medium Date

Then add another text box placed immediately before it, and give it these
properties:
Control Source =[SaleDate]
Format ddd
Enabled No
Locked Yes
Tab Stop No
Name txtSaleDateDay

This box will display the name of the day, so the end result will look
exactly as you requested. But when the user tabs into the date box, it is
obvious to them they they do not need to enter the name of the day (since
that did not get highlighted.)
 
I am using MSA 2003, and am trying to format dates in my tables/queries in
the following format:

ddd","mmm dd","yyyy

The results that I am looking for are, for example, SUN, Feb 12, 2006.

I tried going to the input mask wizard, and creating the mask as above,
changing from text to date, and using _ as a placeholder. However, when I get
to the display box, it inserts the input mask and won't let me type a value,
nor will it let me save the record mask because of that field.
Am I doing something wrong? Or is there a "glitch" that needs to be
corrected? I did notice that un like previous versions of Access when I go
into the mask wizard to create a new mask, there is no button to click for
"New" or "Edit". It doesn't even show the default stored values. Could I have
something missing in my controls?
Thanks

Do NOT enter data directly in a table (or a query). Always use a form.

Are you using a Date datatype field or a Text datatype field to enter
the date into?
I'll assume you are correctly using a Date datatype field.

There is a difference between an Input Mask, which may be used to
enter data in a specific manner, and the way that data is displayed
(how it is formatted).
All you need do to display a valid date datatype field as Sun, Feb
12, 2006 is to set the Format Property of the table field to:

ddd", "mmm dd", "yyyy

The above has nothing to do with any Input Mask.

To assist the user to enter the date on a form, if you wish to use an
Input Mask, set the mask to:
99/99/0000;;_ (Not saved with the data. This is a date field, not a
text field)
Dates should then be entered in the mm/dd/yyyy format.
Set the control's Format property to the same Format as in the table.
As soon as the date has been entered, it will be displayed in your
above format.
 
Back
Top