Queries against multiple tables

C

cehrenre

I have 3 tables. Incidents (main table), Incident_Details (child 1:1
relationship with Incidents) and Incident_TestCases (child 1:Many
relationship with Incidents).

Incidents - holds all defects entered
Incidnent_Details - holds pertinent incident specific information
Incident_TestCases - holds the ID of the test case that identified the
incident along with the IDs of all selected child test cases.

Tables are related by to Incidents.ID by the foreign Key Incident_ID in each
table. There is a unique key on Incident_Details and Incident_TestCases
(Auto-Number).

I have a form to edit the data which works fine.

I have a form to Add Incidents but this doesnt work. I need help writing a
query to set the Add Incidents recordsource so that I can add new incidents.
I can write the query to join the Incidents table to the Incident_Detail
table no problem. But when I add the third table to the query the Incident_ID
of the Incident_TestCases table doesnt get set properly. Its value always
returns ?#Name. The textbox is correctly bound to the query field.

As expected, when the form opens, the main ID is set to (Auto Number). The
Incident_Detail.Incident_ID is set correctly to the ID when a new record is
added. But the Incidents_TestCases.Incident_ID never gets set properly. Im
guessing this is because I do not have the correct query (outer joins).
 

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