Append Querie

D

Dustin

I am running an append qerie that creates a new record with an autonumber
field, but if I run the querie again it creates the same record with a new
number, how do I prevent this?
 
J

Jeff Boyce

Dustin

If you set a 'unique' index on the field (fields) that you need to be unique
in the table, each attempt to append will check to be sure it isn't already
there.

Regards

Jeff Boyce
<Office/Access MVP>
 
6

'69 Camaro

Hi, Dustin.

One prevents duplicate records by creating a unique index on the field or
combination of fields that can't be duplicated. For example, if the
procedure were appending new course names to a table, then the "CourseName"
field would have a unique index and an attempt to append "Beginning Access"
more than once would result in an error message to the user -- and no
duplicate records.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
D

Douglas J Steele

It sounds as though you might be setting the value for the Autonumber field
in your query. What's the SQL (and which is the Autonumber field)?
 
Top