Date input mask question

P

pokdbz

How do you allow any date to be entered into a text field like:
1/5/05
01/05/2005
 
R

Rick Brandt

pokdbz said:
How do you allow any date to be entered into a text field like:
1/5/05
01/05/2005

Don't use a mask. Access will bend over backwards to accept any entry it
can create a date from. InputMasks are terrible in most situations. Use
them very sparingly.
 
P

pokdbz

I would like the short date but it has the format 1/5/2005, but I would like
1/5/05
 
R

Rick B

Either define the exact format (using the Format function) or change your
computer's short date format in the control panel (regional settings).
 
R

Rick Brandt

pokdbz said:
I would like the short date but it has the format 1/5/2005, but I
would like 1/5/05

The "named" formats ("Short Date", "Medium Date", etc.), are controlled by
your regional settings in Windows Control Panel. Explicit formats like
"mm-dd-yyyy" are not affected by the regional settings.

In your case use a format of "m/d/yy".

(two lashes for using a two digit year though :)
 
P

pokdbz

I would like to use the format function. So do I just have to put m/d/yy
when I right click properties for that field and put that in for format
 
R

Rick Brandt

pokdbz said:
I would like to use the format function. So do I just have to put
m/d/yy when I right click properties for that field and put that in
for format

In the format *Property* you would enter that, yes. The Format() function
is a different animal altogether and is NOT what you want.
 
Top