this db is a mess your data isn't even correct to make this work, the reason you're getting more records than you have equipment is because you have no data in your EQUIPMENTID field in your EQUIPMENTHISTORY table.
Look at your equipment history table. There are no equipment ID's recorded.
On the existing records in the database you most recently attached put in an EQUIPMENTID of 2, 3 and 4 on each of the existing records
If you'd followed the method on my original suggestion it would work but I'm basically doing the exact same thing again here except I'm simply assuming that the most recent equipmenthistoryID is the most recent record which may not always be the case.
Save this:
Code:
SELECT EquipmentHistory.EquipmentID, Max(EquipmentHistory.EquipmentHistoryID) AS MaxID
FROM EquipmentHistory
GROUP BY EquipmentHistory.EquipmentID
HAVING (((EquipmentHistory.EquipmentID) Is Not Null And (EquipmentHistory.EquipmentID)<>0));
as qry_MRCheckout
Code:
SELECT Equipment.EquipmentID, Equipment.EquipmentMake, Equipment.EquipmentDescription, Equipment.InService, Equipment.BeingRepaired, Equipment.SerialNumber, Equipment.EquipmentModel, Location.LocationType, Location.LocationAddress2, Location.LocationState, Location.JobNumber, Location.CompanyName, IIf(IsNull([equipmenthistoryid]),"THERE IS NO HISTORY RECORD FOR THIS PIECE OF EQUIPMENT UPDATE YOUR EUQIPMENT HISTORY TABLE OR IT WILL NOT WORK",Null) AS WARNING
FROM Location RIGHT JOIN ((Equipment LEFT JOIN qry_MRCheckout ON Equipment.EquipmentID = qry_MRCheckout.EquipmentID) LEFT JOIN EquipmentHistory ON qry_MRCheckout.MaxID = EquipmentHistory.EquipmentHistoryID) ON Location.LocationID = EquipmentHistory.LocationID;
save this query as query for location