Dates: Entering Without Having To Type Slashes?

P

(PeteCresswell)

Anybody got a way to let users type a date into a textbox without having to
enter the slashes, BUT, also allow the user to enter slashes?

I'm guessing it's some VBA code that counts characters and drops in the
slash.... but if somebody's already invented this particular wheel....
 
R

Rick Brandt

(PeteCresswell) said:
Anybody got a way to let users type a date into a textbox without
having to enter the slashes, BUT, also allow the user to enter
slashes?

I'm guessing it's some VBA code that counts characters and drops in
the slash.... but if somebody's already invented this particular
wheel....

Use an InputMask.
 
P

(PeteCresswell)

Per Rick Brandt:
Use an InputMask.

Yeah, I guess anything else is trying to fool Mother Nature.... I was trolling
for something that would let the user type "152006" or even "156" and have it be
smart enough to return "01/05/2006".
 
B

Bill Mosca, MS Access MVP

Pete

An input mask isn't very forgiving when it comes to the number of digits
required if you go over that number like entering 2006 when a mask is
looking for 06.

When I set up textboxes for dates I use a short date. 99/99/0000;0;_

IMHO, users should be pretty used to 4-digit years by now. If not, too bad.
Typing a slash will get the cursor over to the next slot. The year is the
only one that must have 4 digits.

Trying to code for turning sloppy data entry into correct data is fighting a
losing battle. How do you know what the user intended? And what user could
expect 156 to be interpretted as 1/5/2006?
 
D

Douglas J. Steele

(PeteCresswell) said:
Per Rick Brandt:

Yeah, I guess anything else is trying to fool Mother Nature.... I was
trolling
for something that would let the user type "152006" or even "156" and have
it be
smart enough to return "01/05/2006".

You could always put code in the BeforeUpdate event to reformat it, but I
have no idea how you'd get it to recognize 1232006 as 01/23/2006 and not
12/03/2006 (or vice versa)!
 

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