# MS Access Date Input Masks



## izzyq (Mar 14, 2002)

I am trying to make an input mask for a MS access Database that will display the "MM/DD/YYY" characters in the field when I click on the field. Is there also a way of having the cursor start on the first character so the user can just start typing in the date information without having to move to the first character?

Thank You


----------



## OBP (Mar 8, 2005)

Yes providing that the user tabs in the field the input starts at the left hand side of the date i.e. the day. I use this for the mask 
00/00/0000
with the Format set to Short Date this gives 31/05/2006 for today's date.
You can also set the default to Date() to offer the inout date as the date, which can be overwritten if desired.


----------



## izzyq (Mar 14, 2002)

The tab will work in this case. That's great.

Are you aware of a way to have the actual characters "MM/DD/YYYY" present in the cell so the user know's what format to enter the date in. At this point it just shows up as __/__/____. The user at this point won't know if it MM/DD or DD/MM.

Thanks


----------



## cristobal03 (Aug 5, 2005)

There's a property...

*SelectStart*?

A universal solution requires VBA. I'll bump a model in a minute; I have to find some old code.

chris.

[edit]
The above is to your first question. For the second, um, ... you might try setting the textbox's default value to *MM/DD/YYYY*. I don't know if that will work if it's bound to a Date/Time attribute.
[/edit]


----------



## cristobal03 (Aug 5, 2005)

[bump]

It's *SelStart* not *SelectStart*. (For more information check Access VBA's help files for *SelStart*; you'll be able to find the related properties.)

To set the insertion point to the beginning of a textbox or text-type control--regardless of the entry method (tab key, arrow keys, enter key, mouse click)--place the following line of code in the control's *Enter* event:


```
Me.ActiveControl.SelStart = 0
```
HTH

chris.


----------

