Validation rule for Access 2003

  • Thread starter Thread starter Hasi
  • Start date Start date
H

Hasi

Hi,

I am working on a project in Access 2003 and trying to create a validation
rule for filed in a table.

Requirement:
There are two fields -
1. Con Method - Dropdown with 6 values - A,B,C,D,E & F
2. Prime Number - Numeric field to be entered by user

Condiiton in validation rule should validate following:
If the Con Method field = C then the user must enter the Prime Number field
otherwise Prime Number field can be null.

Question to you if you can answer:
How do we implement this in validation rule for the field -> Prime Number

I was going through your turorials on webpage -
http://www.everythingaccess.com/tutorials.asp?ID=Validation-Rules
but could not get to that point.

Any help is appreciated!!

thanks,
Hasi
 
Thanks Allen. Will try this and let you know the results.

Allen Browne said:
Perhaps something like this in the validation rule of the *table* (not
field):
([Con] Is Null) OR ([Con] <> "C") OR ([Prime Number] Is Not Null)

Be sure to use the table rule:
http://allenbrowne.com/ValidationRule.html#TableValidationRule
--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Hasi said:
Hi,

I am working on a project in Access 2003 and trying to create a validation
rule for filed in a table.

Requirement:
There are two fields -
1. Con Method - Dropdown with 6 values - A,B,C,D,E & F
2. Prime Number - Numeric field to be entered by user

Condiiton in validation rule should validate following:
If the Con Method field = C then the user must enter the Prime Number
field
otherwise Prime Number field can be null.

Question to you if you can answer:
How do we implement this in validation rule for the field -> Prime Number

I was going through your turorials on webpage -
http://www.everythingaccess.com/tutorials.asp?ID=Validation-Rules
but could not get to that point.

Any help is appreciated!!

thanks,
Hasi
 
Back
Top