Duplicate Update Problem

K

Kevin C.

Hi-

I have a query that updates a username to a particular
record in a table. The query is run through a form, and
the user clicks on their name and types in what to assign
to themself. The problem is that there may be possible
duplicate reocrds in the database, but only 1 of the
duplicate records needs to be updated, not both of them.
The only distinguishing feature between the 2 records is
the ID# (Autonumber). How do I tell the query to update
only 1 of the records and not to update all of the
duplicates as well?
 
M

[MVP] S.Clark

Specify the desired ID in the WHERE clause.

Update tablename set fieldname = value where id = {desired id to be updated}


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
G

Guest

This won't work because the user won't know the ID. What
they are typing in is a loan # which is part of the
information that is duplicated in the records.
 
M

[MVP] S.Clark

Ok, then... what else about the record to be updated is unique, and known,
such that only that one will be updated and not the others?
 
G

Guest

The only distinguishing thing about the records that is
different is the ID# (Autonumber). Everything else is
exactly the same.
 
M

[MVP] S.Clark

Then you'll need to implement a method such that the Autonumber can be used.
 
Top