Steve, thanks for your suggestion.
I'm not seeing any duplicates records in the tables - and
the subquery is a TOP 1 query that can only return single
selected values that match the criteria given. When I run
the subquery by itself, I just get the one record (the TOP
1).
What I find really bizarre is that when I run the query
from design view, the query returns records for the column
called 'LastMaintained' for equipment that has been
serviced - then the query pauses for a minute, Access pops
up the 'at most one record...' error, and all of the
fields returned by the query are replaced with #Name?
I swear I used to get records with this query, and have no
idea as to why it won't work anymore... If you have any
ideas, please let me know.
Here's the SQL:
SELECT tblEquipment.EqID, tblEquipTypes.EqType,
tblLocations.RoomNo, tblServiceCompanies.ServiceCompName,
tblEquipment.ServiceNo, tblEquipment.WarrantyExpDate,
tblEquipment.MaintenanceInterval, (SELECT TOP 1
MaintenanceDate FROM tblMaintenanceRecords WHERE
(tblMaintenanceRecords.EqID = tblEquipment.EqID) ORDER BY
MaintenanceDate DESC, tblMaintenanceRecords.EqID ) AS
LastMaintained, tblEquipment.EqName,
tblServiceCompanies.ServiceCompCustomerNumber,
tblServiceCompanies.ServiceCompContractNo,
tblServiceCompanies.ServiceCompContactName,
tblServiceCompanies.ServiceCompPhone,
tblPurchases.PurchaseDate
FROM tblServiceCompanies RIGHT JOIN (tblLocations RIGHT
JOIN (tblEquipTypes RIGHT JOIN (tblEquipment INNER JOIN
tblPurchases ON tblEquipment.EqID = tblPurchases.EqID) ON
tblEquipTypes.EqTypeID = tblEquipment.EqTypeID) ON
tblLocations.LocationID = tblEquipment.LocationID) ON
tblServiceCompanies.ServiceCompID =
tblEquipment.ServiceCompID
WHERE (((tblEquipment.MaintenanceInterval) Is Not Null));