Checking for duplicate prior to appending

roelandkim

Registered User.
Local time
Today, 14:42
Joined
Apr 8, 2003
Messages
38
Hi all,

One of the buttons on a form I have runs an append query which appends a specific client record to a new table, dbo_Tbl_ParticipantData. I would like the OnClick event to trigger a lookup into this new table to see if the record already exists based on SSN. What is the best way to do this? Below is the append query.

INSERT INTO dbo_Tbl_ParticipantData ( FirstName, SSN, LastName, ElitePK )
SELECT Qry_osEntityFormat.FirstName, Qry_osEntityFormat.TaxID, Qry_osEntityFormat.LastName, Qry_osEntityFormat.osEntityFormat
FROM Qry_osEntityFormat
WHERE (((Qry_osEntityFormat.TaxID)=[Enter SSN]));
 
When most of the time, SSN will not be duplicated, it is inefficient to validate it. It is much more efficient to define a unique index on SSN and let the database engine do the work.
 

Users who are viewing this thread

Back
Top Bottom