validation rule- only allow if in other table

M

MooliiBeth

How do I set up a validation rule in a table (and a form) that would not
allow the user to data enter in a table unless the value was in another table?
 
A

Allen Browne

This example assumes that the value for Field1 in Table1 must match an
existing value for Field2 in Table2.

1. Choose Relationships from the Tools menu.

2. Show both tables in the window. (Show Table on Relationships menu.)

3. Drag Table2.Field2 onto Table1.Field1.
Access pops up a dialog.
Check the box for "Referential Integrity."

You will now not be able to add a value to Table2.Field2 unless it exists in
Table1.Field1. Further, you will not be able to change or delete the value
in Table1.Field1 if it is used in Table2.Field2.
 
Top