Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation rule

Status
Not open for further replies.

stat123

Technical User
Jul 19, 2004
10
CA
Hello,

I have an initial table (table1)containing 15,000 records. The user may enter records in table 2; I want to have a validation rule that checks if the record entered by the user is in table 1 (it has to be in there, to be able to proceed any further).

How can I do the above using a validation rule in the table design view?

Thank you for your help!
 
It seems to me that validation would be take care of if you establish a relationship between the two tables, where Table 1 represents the parent side of the relationship and table two represents the child.
If the field in table 1 is a key field, than you can establish such a relationship with table 2 by setting the Indexed property of the field in table 1 to allow no duplicates.
Is that what you are looking for?
Vince
 
Thank you for your response Vince.

This is one part of it: not to allow duplicates. But when the user enter a record number in table 2, I want to be able to check if the record exists in table 1; if not, an error message should pop up.
 
If you set your relationships, as suggested by vpelleri, an error message WILL be displayed upon any attempt to enter an unrelated record in table 2.

Randy
 
Anyway you may have a look at the DLookUp function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top