By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,917 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,917 IT Pros & Developers. It's quick & easy.

Date Format (Input mask) that converts null entry to "0"

P: 1
I am using Access, 2003. I have an entry form (single form) with a date field. I would like the user to be able to enter:
115 08
and have Access store and display the date as:
11/05/08, even though the zero was not entered. I am familiar with customizing formats and input masks, but cannot find any hint in the help section of how to achieve this. Is it possible? Maybe using VB (I am a novice at VB)?

Thanks
Nov 19 '08 #1
Share this Question
Share on Google+
1 Reply


missinglinq
Expert 2.5K+
P: 3,532
The sample data you posted is perfect for pointing out the difficulty of this task! How could Access possibly tell whether

115 08

is supposed to be

11/05/08

or

1/15/08?

Your example showed a space between the month/day and the year. Was this intentional? If there was ***always*** a space between month and day and year, it could be done, but it would have to ***always*** be done in this way, one user couldn't do this way with another one doing it in the correct manner. If there was always a space between Month and Day and year this code would work:

Private Sub SloppyDate_AfterUpdate()
Me.SloppyDate = Replace(Me.SloppyDate, " ", "/")
End Sub.

I have to tell you, having worked in a production data entry environment at one time, that ***not*** entering a date as 11/5/08 is going to be more awkward/slower for the average user than how you're proposing.

If you're concerned about ease of date entry, use a Calendar control, either a native ActiveX control or one of the many form-based ones available online.

Welcome to Bytes!

Linq ;0)>.


.
Nov 20 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.