I created this procedure for resetting autonumbers.
I would like to mention however that autonumbers are not necessarily
always consecutive. If you start to add a record and cancel it then
the next record you attempt to add will have the next autonumber in
the sequence.
You need to add the Reference:
"Microsoft ADO Ext. 2.8 for DDL and Security"
' ************************************************** *****************
' resestSeed - resets an autonumber field
' ************************************************** *****************
' tableName - the table that contains the autonumber
' fieldName - the field that is the autonumber
' seedValue - where you want the new autonumber to start
' ************************************************** *****************
Public Sub resetSeed(tableName As String, fieldName As String,
seedValue As Integer)
Dim cat As New ADOX.Catalog
Set cat.ActiveConnection = CurrentProject.Connection
cat.Tables(tableName).Columns(fieldName).Propertie s("Seed") =
seedValue
End Sub
Cheers,
Jason Lepack
On Apr 30, 6:24 am, "hugz via AccessMonster.com" <u33625@uwewrote:
How can u reset the autonumber field back to 1? answer pls.. thnx for your
help..
--
Message posted viahttp://www.accessmonster.com