On May 14, 9:03*am, sharsy <sh...@ptpartners.net.auwrote:
Hi guys,
I would like to setup a validation rule for a database in microsoft
access that restricts data entry so that a certain field can only be
filled in if another field has a specific answer (that is selected via
a drop down list).
Example
Field1 - options are "In" or "Out"
Field2 - options are "Join" or "Not Joining"
I want a validation rule that only allows a user to select one of the
options in Field2 only when "In" is selected in Field1. If "Out" is
selected in Field1, then I don't want the user to be able enter data
into Field2 at all.
I'm not a computer illiterate but this is beyond me so f anyone could
help me out i would really appreciate it!!!!!!!!
Thanks! Sharsy
Hi Sharsy
You can do this using a table-level validation rule in an Access
database. A table-level validation rule is different from a field-
level validation rule in that (a) it can check for values in
combinations of different fields, not just one field, and (b) your
record is checked against the rule at the time the record is saved,
not when you enter data the field(s) in question.
To set up a table-level validation rule, open your table in design
view and open the table property sheet (ALT+ENTER).
In the Validation rule property, enter the expression you want as your
validation rule.
Something like
IsNull([field2]) Or ([field1]="In")
should work for the case you describe.
You can also use the Validation Text property to specify a text
message that your end users would see if they tried to save a record
which doesn't meet the table validation rule.