Custom Date Formats

  • Thread starter Thread starter Sue
  • Start date Start date
S

Sue

Access 97

My form has to capture a custom date format.
I've tried the following code but it doesn't seem to work:

Private Sub txtDate1_AfterUpdate()
txtDate1 = format("mmmm dd, yyyy")
end sub

Any ideas?
Thank you very much
 
Internally, Access treats dates as numeric values.
The formatting affects only how it is displayed.

Just set the Format property of the text box instead of trying to alter its
value in its AfterUpdate event.
 
I must be missing something. I'm not sure where to set the
custom format in the text box. These fields will be used
in a Word merge project and need the mmmm dd, yyyy format.
Thanks for any advise,
Sue
 
I must be missing something. I'm not sure where to set the
custom format in the text box. These fields will be used
in a Word merge project and need the mmmm dd, yyyy format.
Thanks for any advise,
Sue

You can't mailmerge from a Form, but you can mailmerge from a Table or
from a Query.

I'd suggest the latter. Create a Query based on your table, and
include in it a calculated field:

ExpDate: Format([datefield], "mmmm dd, yyyy")

This calculated field will contain a Text value (not a Date/Time) in
the specified format, and Word will treat it as a simple text string
containing 'October 14, 2003'.
 
Back
Top