Referential Integrity with intermediate table (1 Viewer)

DataMiner

Registered User.
Local time
Today, 14:03
Joined
Jul 26, 2001
Messages
336
Table Repairs has fields:
FailureBarCode
RefDes

Table FailureBarCodes has fields:
FailureBarCode (Primary Key)
ProductItemNo
AssyItemNo

Table BOMs has fields:
AssyItemNo
RefDes
(The two fields combined are the primary Key)

I want referential integrity so that a refdes can't be entered in the Repairs table unless it exists for the AssyItemNo in the BOms table. Is this possible? Is there a better way to design this?

Using Access 2002.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 14:03
Joined
Sep 12, 2006
Messages
15,653
i'm sure you can just add these tables and link them as you want. if you can't access will tell you
 

DataMiner

Registered User.
Local time
Today, 14:03
Joined
Jul 26, 2001
Messages
336
I have attached a picture of the relationship I want.

In table Repairs, there is no primary key: Each barcode can have many entries with the same or different refdes.

Table FailureBarCodes defines additional information about the barcode. Here, barcode is the primary key, and we find out what assemblyItemNo it is.

Table BOM is the bill of materials by assemblyItemNo. It lists all the RefDes that are valid for each AssemblyNo.

I want to avoid having invalid refdes entered in the Repairs table.

I certainly know ways to accomplish this through carefuly design of the data entry forms. But it seems like I ought to be able to set up referential integrity in the basic design to accomplish the same thing.

If I add AssemblyItemNo to the Repairs table, I can enforce referential integrity that I want, but then I've violated normalization rules. So I keep thinking I've just got the design wrong.....?
 

Attachments

  • Relat.bmp
    14.7 KB · Views: 406

DataMiner

Registered User.
Local time
Today, 14:03
Joined
Jul 26, 2001
Messages
336
I've yet to receive any responses to my previous post so am just rattling the cage. Is it just not possible to enforce referential integrity this way? Do I have to violate normalization rules to do it?:(
 

Users who are viewing this thread

Top Bottom