Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can I enter 083105 in a form and have it store at 08/31/05?

Status
Not open for further replies.

keun

Technical User
Jul 15, 2005
262
0
0
US
The subject says it all.

I am used to entering 0 8 / 3 1 / 0 5 and i am fine with that. However I have a user that just wants to enter 0 8 3 1 0 5 and have that work. HAs anyone ever done this?

Also, if it is possible, once it is done, does 0 8 / 3 1 / 0 5 stop working? Or can I have my cake and eat it too?

thanks
 
Try a medium date format. Something like

99/99/99;;_

Hope that helps.
 
If you specify a format string of __/__/__ then all you type is 083105 and depending upon your PC's regional settings, it will interpret it as you wish.

However to enter 083105 as text and turn it into a date,
Code:
dtVal = DateSerial(Right(strInput,2),Left(strInput,2),Mid(strInput,3,2))
 
I know I am dense, but where do I put that dtVal?
 
I think PCLewis is complicating this one a little.

I'm assuming you're entering the date into a text box?

The way I do this is to set an input mask of '00/00/00;_' (take out the inverted commas). The input mask is on the Data tab of the text box properties.

Doing this will accept the user entering BOTH 083105 AND 08/31/05.
 
After reading the rest of this board I found this same question was asked yesterday. I got the solution by:

On the table, Format = mm/dd/yy, Input Mask = 00/00/00
On the form: Input Mask = 00/00/00

Works cool!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top