Link to home
Create AccountLog in
Avatar of pcalabria
pcalabriaFlag for United States of America

asked on

Need help creating a MS Access query using Left Join

I need help creating a recordset when two tables are joined with left join.

The following query displays all the records in Parts4Sales and the matching ComponentMaster record ID.  

While I can see records which do not match a record in the ComponentMaster table, because the ID appears as blank, I can not selected them.

Here's my query:

SELECT Parts4Sales.PartID, ComponentMaster.ID
FROM Parts4Sales LEFT JOIN Component Master ON (Parts4Sales.SearchNumber = ComponentMaster.SearchNumber) AND (Parts4Sales.LineID = ComponentMaster.LineID);

My plan is to create a recordset using a query that includes only records without a match in the ComponentMaster table, and then loop through the recordset running code to create a matching ComponentMaster record.

Please help!  THanks
Avatar of PatHartman
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of pcalabria


I thought I had tried that before posting... but apparently made a mistake.

Thanks again, as always, Pat!
You're welcome:)