Data from one of three tables not being picked up in query.

G

Guest

I have a query encompassing three main tables: tblProjects, tblFunctionSet,
and tblBugs (the DB is a small bug tracking tool). Basically, one Project can
have many Function Sets, and one Function Set can have many Bugs. The
relationship between tblFunctionSet and tblBugs is working fine, but the
relationship between tblProjects and tblFunctionSet isn't. (I have set up
Project ID as a foreign key in tblFunctionSet, and Function Set ID as a
foreign key in tblBugs.) For example, in the datasheet view of the query I'm
trying to build, the records for fields from tblFunctionSet and tblBugs
appear, but no data from the fields from tblProjects appears. Below is the
SQL from the query. My apologies for the formatting. That's how it looks in
Access and I don't know how to make it more tidy.

(Note: tblCreatedBy, tblOwner, and tblSignoff are just supplying a list of
names for use in combo box fields, and don't really affect this as far as I
know.)

SELECT tblBugs.[Bug ID], tblBugs.[Created By ID], tblCreatedBy.[Created By],
tblBugs.[Owner ID], tblOwner.Owner, tblBugs.[Signoff ID], tblSignoff.Signoff,
tblFunctionSet.[Function Set ID], tblFunctionSet.[Function Set],
tblFunctionSet.[Function Set Description], tblProjects.[Project ID],
tblProjects.Project, tblProjects.[Testing Start Date], tblProjects.[Testing
End Date], tblProjects.[Project Doc1], tblProjects.[Project Doc2],
tblProjects.[Project Doc3]
FROM tblProjects RIGHT JOIN (tblFunctionSet RIGHT JOIN (tblSignoff RIGHT
JOIN (tblOwner RIGHT JOIN (tblBugs INNER JOIN tblCreatedBy ON
tblBugs.[Created By ID] = tblCreatedBy.[Created By ID]) ON tblOwner.[Owner
ID] = tblBugs.[Owner ID]) ON tblSignoff.[Signoff ID] = tblBugs.[Signoff ID])
ON tblFunctionSet.[Function Set ID] = tblBugs.[Function Set ID]) ON
tblProjects.[Project ID] = tblFunctionSet.[Project ID];
 
G

Guest

hi,
first, the data to the combo box should be in a seperate
query. that is just confuseing the issue here.
get ride fo the unnecessary tables and all the inner
joins, make them right 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