Date Format

G

Guest

Is there a way to have date separators applied automatically in a word form
field without having to type the slashes (i.e. 00/00/00)? I know it will
apply them if you use a "createdate" or other like field but I prefer to have
the ability to enter the date manually but would like to have the slashes
entered without my having to type them.
Thank you for any help provided
 
B

Beth Melton

If you are trying to avoid typing a date separator, such as a hyphen
or forward slash, then you can create a create a macro and attach it
to the OnExit event of the form field to create the date format you
want and return the result to the form field. The Format function
would be the easiest way but there are other alternatives.

Note you would need to use a Text data type instead of a Date data
type for the form field so if you want to make sure you are using a
valid date your macro would need to include the date validation. And,
of course, you would want to accommodate the possibility of editing
the date after it has been formatted to avoid macro errors.
--
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/
 
G

Guest

Thank you for the help Beth>

Beth Melton said:
If you are trying to avoid typing a date separator, such as a hyphen
or forward slash, then you can create a create a macro and attach it
to the OnExit event of the form field to create the date format you
want and return the result to the form field. The Format function
would be the easiest way but there are other alternatives.

Note you would need to use a Text data type instead of a Date data
type for the form field so if you want to make sure you are using a
valid date your macro would need to include the date validation. And,
of course, you would want to accommodate the possibility of editing
the date after it has been formatted to avoid macro errors.
--
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/
 

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