II have a DB I am working on and have stumbled onto a
problem.
Basically, I have a lighting fixture that
can hold up to three lamps in any combination including no lamp in a
socket.
Using Access
2007
Orders
Orders_ID
PO#
Qty
FixtureID (PK)
tblFixtures
Fix_ID
FixtureID (PK)
Socket1
Socket2
Socket3
tblLamps
Lamp_ID
LampCode (PK)
LampCost
Description
Report
(How many lamps of each kind do I need to buy and the cost of each
lamp and total of all lamps?)
Qty – Each type of lamp – Lamp description - Lamp Cost – Lamp Total (including all lamp types from any sockets)
22 L001 25w $2.15 $47.30
15 L002 40w $2.25 $33.75
42 L003 60w $2.50 $105.00
Query
Qty-FixtureID-Socket1-Description-LampCost-Socket2-Description-LampCost-Socket3-Description-LampCost
I am only getting the first socket data.
Data for the 2nd an 3rd cost and description is duplicated
from the first socket
Relationship
One - tblFixtures.FixtureID to Many tblOrders.FixtureID
One - tblFixtures.Socket1, Socket2, Socket3 to Many tblLamps.LampCode
Join Properties is all records from Include ALL records from 'tblFixtures' and
only those records from
'tblLamps' where the joined fields are equal.
There are three links from Socket1, Socket2 and Socket3 to
tblLamps.LampCode
I tried the three join
options with no luck.
I think the problem lies
with the relationship between tblLamps and tblFixture but I just can't get it.
I just want to be able to pull the cost and description for each socket on a report, based off of the LampCode there will be three lamps per fixture.
Hope I included enough info.