Validation Rule

J

jean

Hi

I am trying to put some validation rules on a field in a form.

I want to limit the user to this

Main Office follow by a space and then 2 number (these number can be
anyone). example "Main Office 40" or "Main Office 62"

User can also use word Site with the same rules like "Site 35" or
"Site 61"

He can also use the word Outside again with the same rules "Outside
50" or "Outside 86"

I can put some rules like "Site" or "Outside" or "Main Office", but I
am stuck with the end part (space and with free 2 digits at the end
(numbers)

I am thinking to put some script on the "after update" of the field

Can someone give me a hint ?

thanks
 
J

Jeff Boyce

Jean

It seems a bit unfriendly to require users to know & remember the exact
spelling and punctuation.

As an alternate approach, since the initial "phrase" is known and set, why
not use a combobox to give them a choice of "Main Office", or "Site" or
"Outside"?

Then, if the number is also constrained (for example, "Main Office" can only
be "40" or "62"), then use a second combobox (see "Cascading Comboboxes")
whose values are constrained by the choice in the first.

This way, you'll never have to deal with someone entering "Maine Off Us
99"...

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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

Top