Updating a local table from a linked table workaround

As I said in post #13 the number of records in the linked source table determines the number of times the code loops. If you want to cut down on that we need to filter the linked source file, I guess that filter would need to be based on what's in the local destination file. I need to think about this one a bit. I'll try to get you an answer soon.
 
In the attached database I changed the destination records source from just being the local table to a query name qrySource. The SQL of this query is:

Code:
SELECT MyCsvData_linked.[amazon-order-id], MyCsvData_linked.AmazonDispatchedDate
FROM MyCsvData_linked INNER JOIN MyCsvData_local ON MyCsvData_linked.[amazon-order-id] = MyCsvData_local.OrderID
WHERE (((MyCsvData_local.DispatchedDate) Is Null));

This limits the records searched in the source file to records that have matching order numbers in the destination table whose date is null. Please test this to see if it works the way you want.
 

Attachments

That works exactly how I'd like it to - thank you :-)

There's a lot to absorb here (not exactly intuitive stuff either!) ...it's at time like these, I realise that I'm just not cut out for this programming melarkey!
 

Users who are viewing this thread

Back
Top Bottom