Custom Date Formats

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
 
A

Allen Browne

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.
 
S

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
 
J

John Vinson

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'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top