validation rule- only allow if in other table

G

Guest

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.
 

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