mm/yyyy

A

Adrian Brown

The client for a program i have written in access have asked for the ability
to enter the date in any of the following format
mm/yy
mm/yyyy
dd/mm/yy
dd/mm/yyyy

Is there any automatic way to allow this or do i have to write some vba code
to handle converting it and store it as text?
 
R

Rick Brandt

Adrian said:
The client for a program i have written in access have asked for the
ability to enter the date in any of the following format
mm/yy
mm/yyyy
dd/mm/yy
dd/mm/yyyy

Is there any automatic way to allow this or do i have to write some
vba code to handle converting it and store it as text?

If you don't apply an input mask of any kind then Access will let you enter
the date any way you want and will try to make sense of it. It will assume
the first of the month if you don't enter a day and it will use the Regional
Settings to translate ambiguous entries as far as month/day/year is
concerned. This last area is where you can get results that are not what
you want.

The only way to have absolute control is to have three separate Textboxes
for day, month, and year and then use some code to build a date from the
entries. This allows you to use your own "rules" for the controls that are
left empty.
 

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