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