sbeltyukov
Technical User
Hi,
The user wants all of the records in the database to have continuous numbering. I have used AutoNumber in the past but if you delete a record, it produces gaps in the numbering. I was wondering if there is a way to number the records so they are always numbered continuously (1, 2, 3, etc.) even if some record is deleted.
I have tried using the following:
but I still cannot get the records to have continuous numbering after a record is deleted.
Any helped would be appreciated.
Thanks!
The user wants all of the records in the database to have continuous numbering. I have used AutoNumber in the past but if you delete a record, it produces gaps in the numbering. I was wondering if there is a way to number the records so they are always numbered continuously (1, 2, 3, etc.) even if some record is deleted.
I have tried using the following:
Code:
Set db = CurrentDb()
Set recordlist = db.Openrecordset("SELECT Max(tblContactHistory.ItemID) AS MaxID FROM tblContactHistory")
ItemID = (recordlist!MaxID + 1)
recordlist.Close
Set recordlist = Nothing
but I still cannot get the records to have continuous numbering after a record is deleted.
Any helped would be appreciated.
Thanks!