Undo/Delete Record

Humberto

Registered User.
Local time
Today, 21:24
Joined
Jan 8, 2002
Messages
40
Hello, I have a form where I'm entering new records. It has an Autonumber. My question is, If I undo or delete the current record, how can I make to Autonumber not to advance to the next number. Right now, when I delete or undo the record, it will advance one number. I just want the autonumber to advance when I save the record. Can someone Help. Thank you
 
The autonumber feature won't let you do that. It always advances 1 even when some have been deleted.
 
Thanks for replying. Is there another method to produce a unique number per record added to the table?
 
You can do so through code. If you create a field in your table then whenever you want to run this procedure it will walk through each record and add a number to the record starting with 1.

Dim i As Integer
Dim rst As DAO.Recordset

i=1

Set rst=CurrentDb.Openrecordset("[Table Name]")

rst.MoveFirst

Do Until rst.EOF
rst.Field("[Field Name]")=i
i=i+1
rst.MoveNext
Loop
 

Users who are viewing this thread

Back
Top Bottom