Prevent user navigating from a field in entry is invalid

TimTDP

Registered User.
Local time
Today, 19:02
Joined
Oct 24, 2008
Messages
213
I need to ensure that the data entered into a field on a form is correct. The field contains an email address and I have a function to check if the format is correct.

If the format is incorrect I need the cursor to return to the field in that record. The form is continuous.

What event should I use?

Thanks
 
Im just getting back into access, its been a few years, what I would do is create a conditional format to where if the field is not "like" "blah@blah.com", it highlights it in red... for you can use the "like" operator and a "goto control" command...

You can use the Like operator to find values in a field that match the pattern you specify. For pattern, you can specify the complete value (for example,

Like “Smith”
or
Like "blah_blah@blah.com"

Im not sure, look into that. Hope it helps
 
On the control's or the form's BeforeUpdate event, set the cancel to true if the E-mail entered is wrong.
 

Users who are viewing this thread

Back
Top Bottom