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

Validation : Do not go to next record

P: n/a
Hi

I have a generic form to keep data. I.e, date, number, string all are
stored as TEXT in different rows in a same table.

i would like to validate that the date is in a correct format. The
different rows appear in the 'Detailed" section. May i know how do i
prevent the "focus" to jump to the next row if there is a validation
error until it conforms to my requirement. I have tried using
GotoRecord but it does not give the kind of effect that i want. I wish
to have something like how "Validation Rule" forces the correction of
data entry. Do not go to next row until you solve the current row's
problem.

Thank you
Boon Yiang

Dec 30 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Use the BeforeUpdate event of the text box if you wish to run code to test
if the value IsDate().

Seriously though, you could solve this by changing the data type of the
field to date/time, and you need no code at all. You will also avoid a
plethora of problems such as:
- wrong results when you aapply criteria to dates that are just text,
- sorting problems,
- problems in the the values are interpreted differently if users have
different regional settings.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<ch****@hotmail.comwrote in message
news:11**********************@h40g2000cwb.googlegr oups.com...
Hi

I have a generic form to keep data. I.e, date, number, string all are
stored as TEXT in different rows in a same table.

i would like to validate that the date is in a correct format. The
different rows appear in the 'Detailed" section. May i know how do i
prevent the "focus" to jump to the next row if there is a validation
error until it conforms to my requirement. I have tried using
GotoRecord but it does not give the kind of effect that i want. I wish
to have something like how "Validation Rule" forces the correction of
data entry. Do not go to next row until you solve the current row's
problem.

Thank you
Boon Yiang
Dec 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.