Validation Rules (1 Viewer)

faradhi

Registered User.
Local time
Today, 20:37
Joined
Mar 7, 2002
Messages
13
I have a table called tlbAsset that has the following fields.

tagid (primary Key)
Make
Model
UserId
SerialNum

I have another table called tblproducts that has the following

Make (primary key)
Model (primary key)
Type

I would like to set the validation rule in tblAsset to only allow combinations of Make and Model that appear in tblproducts.

Can I acomplish this at the table level? If not what would the best method to acomplish this task?
I would like to do it at the table so that any forms greated from this table would be required to follow this rule.
:confused:
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:37
Joined
Feb 19, 2002
Messages
43,408
The only way I was able to make RI work on a multi-part foreiqn key was to include the fields in the pk which would make the Asset table look like:

Make (primary key fld1)
Model (primary key fld2)
tagid (primary Key fld3)
UserId
SerialNum


Since tagid is an autonumber, this change will not affect anything except that it will make Make and Model required.

An alternate solution is to add a MakeModelID (autonumber) to tblProducts and then use MakeModelID as the foreign key in tblAssets.
 

Users who are viewing this thread

Top Bottom