Primary/ Foreign key Problem

G

Guest

I have a simple query-based form on three tables- locations, equipment, and
results. For each location I have multiple equipment records, and for each
piece of equipment I want to be able to create a specific results record.

I have a query first linking the Locations and Equipment tables and then
another query linking the first query with the Results table.

There is a primary key linking locations and equipment (Location ID Auto#),
and then another linking the equipment to the results (Equipment ID Auto #).
The problem I'm having is that the Results table is not recording the
Equipment ID, so I'm recording data but its not referencing any equipment.

I'm sure its something easy. Thanks

- mat
 
G

Guest

You need to set a one-to-many relation in the Relations window. Select
Referential Integrity and Cascade Updates.
 
G

Guest

I'm sorry, I should have mentioned that I already have those selected. There
is a one-to-many relationship between both the locations and equipment table
and then equipment and results tables also.

Is there a problem with having a primary key for the location and equipment
 
G

Guest

Use several forms with subforms. If you are entering equipment then have
location in the main form and equipment in the subform.
If entering results the have equipment in the main form and results in the
subform.
 

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