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

input mask on date field

P: n/a
In my application, a text box control resides in a form. The text box
control is unbound, but--assuming all edits are passed when the user
click a command button on the form--the contents of the text box
control end up in a field in a table with a data type of Date/Time.
Is it possible to set up a mask on this text box control such that if
one types any any of the following sequence of characters into the
text box

06/25/04
6/25/04
062504

the result is that:
a) the date 06/25/04 is displayed in the text box
b) the date 06/25/2004 gets written to the field in the table
(assuming all edits are passed after the user clicks the command
button)

If it is not possible to accomplish this using only a mask, is it
possible to accomplish it through some combination of mask and VBA
code?
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If you set the Input Mask under the controls Properties to Short Date
(99/99/0000;0;_) the user can type 06252004 and it will entered as
06/25/2004, I also suggest you set the Input Mask in the table to the same
format.

Charlie O'Neill

"Miranda Evans" <mi************@yahoo.com> wrote in message
news:59*************************@posting.google.co m...
In my application, a text box control resides in a form. The text box
control is unbound, but--assuming all edits are passed when the user
click a command button on the form--the contents of the text box
control end up in a field in a table with a data type of Date/Time.
Is it possible to set up a mask on this text box control such that if
one types any any of the following sequence of characters into the
text box

06/25/04
6/25/04
062504

the result is that:
a) the date 06/25/04 is displayed in the text box
b) the date 06/25/2004 gets written to the field in the table
(assuming all edits are passed after the user clicks the command
button)

If it is not possible to accomplish this using only a mask, is it
possible to accomplish it through some combination of mask and VBA
code?

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.