H
hubbiida via AccessMonster.com
Hi,
I have a created a "duplicate" button on a form in Access 2003. Two fields on
the form are set as "duplicates not allowed" at the table level: one is a
standard field and one is an auto-number field (the key field for the primary
table of the underlying query). If I duplicate a record and attempt to go to
the next or previous record forgetting to change the value in the no-dupes
field first, I get the standard Access error. The funny thing is that if I
then change the standard no-dupes field (the other, again, being auto-number
field), I still get the error. As a result of this, I must exit the form, at
which point I get a message saying my changes will not be saved.
But, here is the really odd part: if I return to the form and successfully
duplicate a record after first erroring out, I find that the auto-number
field has jumped one ahead in the numeric sequence, although no new record
has been created. In other words, if the highest number in that field before
the error was 100, after the error the next number assigned to a new record
will be 102, not 101, as though there is a ghost record...
Any ideas?
(PS: If I do not forget to update the standard no-dupes field before
attempting to go to another record, there is no problem.)
I have a created a "duplicate" button on a form in Access 2003. Two fields on
the form are set as "duplicates not allowed" at the table level: one is a
standard field and one is an auto-number field (the key field for the primary
table of the underlying query). If I duplicate a record and attempt to go to
the next or previous record forgetting to change the value in the no-dupes
field first, I get the standard Access error. The funny thing is that if I
then change the standard no-dupes field (the other, again, being auto-number
field), I still get the error. As a result of this, I must exit the form, at
which point I get a message saying my changes will not be saved.
But, here is the really odd part: if I return to the form and successfully
duplicate a record after first erroring out, I find that the auto-number
field has jumped one ahead in the numeric sequence, although no new record
has been created. In other words, if the highest number in that field before
the error was 100, after the error the next number assigned to a new record
will be 102, not 101, as though there is a ghost record...
Any ideas?
(PS: If I do not forget to update the standard no-dupes field before
attempting to go to another record, there is no problem.)