I use the following statement to delete all Customers that have no entry in tblTransaction
DoCmd.RunSQL "DELETE FROM tblCustomer " _
& " WHERE NOT EXISTS (SELECT * FROM tblTransaction WHERE tblCustomer!lngCustomerID = tblTransaction!lngPartyID) ;"
In the specific case there are 7000 customers. The only problem is that it takes 100 seconds on an i7, 8gb ram pc.
Is there a more efficient way of doing this?
John
DoCmd.RunSQL "DELETE FROM tblCustomer " _
& " WHERE NOT EXISTS (SELECT * FROM tblTransaction WHERE tblCustomer!lngCustomerID = tblTransaction!lngPartyID) ;"
In the specific case there are 7000 customers. The only problem is that it takes 100 seconds on an i7, 8gb ram pc.
Is there a more efficient way of doing this?
John