Relationship confusion

Christine Pearc

Christine
Local time
Today, 09:15
Joined
May 13, 2004
Messages
111
I’ve gotton myself completely confused with relationships and need some help.

In tblCARs I have a field called OwnerID.

OwnerID should get its value from tblProcesses, which has the following fields:

ProcessID (autonumber)
Process (a descriptive text field)
OwnerID (gets its value from:
SELECT qryEmployees.EmployeeID, qryEmployees.FullName FROM qryEmployees;

In a query, I want to display the FullName associated with the OwnerID – not the EmployeeID.

How should the relationship be set up for the query, and what should the query output field me? I’ve tried all sorts of link combinations, with no success.
 
If you want to select the tblcars.ownerid field and the associated fullname of that ownerid, this should work: SELECT tblcars.ownerid,qryemployees.FullName FROM tblcars, qryemployees WHERE qryemployees.EmployeeId = tblcars.OwnerId

How are tblprocesses and tblcars related? The setup you described sounds a bit confusing because you're using the tblprocesses table as a middle-man to retrieve the owner information, which you don't necessarily have to do. You can probably link the ownerid field of tblcars directly to the qryemployees query. If you later want to link tblprocesses and tblcars records, they both have that ownerid field, so you can retrieve relevant information with query like

SELECT [fields you want from tblcars and tblprocesses] FROM tblcars,tblprocesses WHERE tblcars.ownerid = tblprocesses.ownerid

this would return the fields from each table with matching owners.


Hope this helps.

-Chappy
 

Users who are viewing this thread

Back
Top Bottom