Hello all,
I'm attempting to construct and append query that appends data from an imported data table (tblImport) to the main transaction table (tblTransactions); however, I only want to import records that do not already appear in tblTransactions. Both tblImport and tblTransactions have a unique TransactionID field (not autonumber). The tblTransactions has two relationships, one with CustID and one with DeptID and is "enforcing referential integrity". The tblImport table is stand-alone. I have both tables added to the query and have setup the criteria as follows for the tblImport.TransactionID column:
<>[tblTransactions]![TransactionID]
There are 132 records in tblTransactions and 139 in tblImport. When I run the query it tells me it will append 18216 rows. I say yes. Access then says it couldn't add 18209 records due to key violations (referential integrity). The seven remaining new records get imported.
My question is why is Access trying to add 18000+ records based on the criteria? Am I missing something? How might I fix this?
Any advice/comments you can offer would be appreciated.
Thanks,
-Jeff Lush
I'm attempting to construct and append query that appends data from an imported data table (tblImport) to the main transaction table (tblTransactions); however, I only want to import records that do not already appear in tblTransactions. Both tblImport and tblTransactions have a unique TransactionID field (not autonumber). The tblTransactions has two relationships, one with CustID and one with DeptID and is "enforcing referential integrity". The tblImport table is stand-alone. I have both tables added to the query and have setup the criteria as follows for the tblImport.TransactionID column:
<>[tblTransactions]![TransactionID]
There are 132 records in tblTransactions and 139 in tblImport. When I run the query it tells me it will append 18216 rows. I say yes. Access then says it couldn't add 18209 records due to key violations (referential integrity). The seven remaining new records get imported.
My question is why is Access trying to add 18000+ records based on the criteria? Am I missing something? How might I fix this?
Any advice/comments you can offer would be appreciated.
Thanks,
-Jeff Lush