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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation Rule & Text

Status
Not open for further replies.

greeneyerat

Technical User
Oct 15, 2003
26
0
0
US
Hi,

On a particular date field I have a date input mask which is a medium date (ex: 01-Jan-05). This is the format I want for the field. It works fine but when the format is not followed MS Access give its own error message.

How would I go about creating a Validation Rule for the format I want so that the Validation text I want is what appears to the user?

Thanks in advance for your help!

Javier.
 
Javier

I am not sure if I understand the specific problem...

when the format is not followed MS Access give its own error message.

Do you mean that if the end user does not follow the dd-mmm-yy format they get an error?

You can use an InputMask which controls the way data is inputed which can be different than the way data is displayed.

You can programmatically change / control the mask...
Me.YourDateField.Format = "mmm-dd-yyyy" or "dd-mmm-yy" depending on conditions.

Lastly, you can use a text box, use full control with the VBA coding, and then once satstified, update the date field which could be a hidden text box. This way, you can control error messages, etc.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top