Append if Record Doesnt Exist, Else Update (1 Viewer)

proballin

Registered User.
Local time
Today, 07:26
Joined
Feb 18, 2008
Messages
105
I have a table that is filled based on selections that a user makes in combo boxes on a form. I am having trouble trying to figure out the best way to prevent duplicates from being inserted in the table when I do the append query part.

Since the table is filled based on the various selections the user makes I dont have a primary key or unique field.

Can someone help me figure out the best way to do this append/update queries to prevent duplicates. Also if you have a strategy for setting up some sort of unique or primary key for fields that could all be the same yet in the table only 1 record will show, no duplicates.
 

neileg

AWF VIP
Local time
Today, 12:26
Joined
Dec 4, 2002
Messages
5,975
You could use DCount() to count the number of matching records in the table. If the count is anything other than 0, don't append.
 

Users who are viewing this thread

Top Bottom