ValidationRule Property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need Validation Rules for Table's Design view.
Email Address's Validation Rules
Zip Code's Validation Rules
In addition do I need set input mask for Email Address's and zip codes.
Finally an example of error messages that will pop up if inputted with wrong
information.
 
On Fri, 8 Sep 2006 10:30:01 -0700, Urban Planning Major <Urban Planning
I need Validation Rules for Table's Design view.
Email Address's Validation Rules

This is basically an impossible request. The only useful definition of a
valid email address is one that your email system can successfully use
to send a message to a recipient - and the only way you can determine
whether that has happened is to ask the recipient, which is usually
impractical.

In real life the best you can hope for is a rule that only accepts
things that look like valid email addresses. Unfortunately the rules for
the form of an email address are vastly more complicated than most
people think. If you use a simple test such as

Is Null Or (Like "?*@*.[A-Za-z][A-Za-z]*" And (Not Like "*@*@*"))

("must contain exactly one @ which must not be the first character, and
must end with . followed two or more letters") then (a) most of the
potential strings that pass the test will not be valid email addresses,
and (b) many valid email addresses will fail the test.
Zip Code's Validation Rules

It's easy to use

Is Null Or Like "#####" Or Like "#####-####"

to allow only strings of digits that look like ZIP codes, but again it
does nothing to ensure that it's actually a real code, let alone the
right one for the street and city in question. It also means that you'll
never be able to handle addresses from any other country. If there is a
possibility that you will ever get international addresses, you either
have to work out a rule that will accept all those postal codes - or,
much simpler, don't bother with the validation rule.
In addition do I need set input mask for Email Address's and zip codes.
No.

Finally an example of error messages that will pop up if inputted with wrong
information.

You can put anything you like in the Validation Text. How about "Can't
you even enter something that at least looks as if it might be valid,
bozo?"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top