(...)
How do I change the starting value of autonumber ie other than 1(Access
2007)?
In VBA code (module, immediate window) You may write something like this:
DoCmd.RunSQL "alter table Table1 alter column ID counter(X,1)"
X - starting value
You can also use the query:
alter table Table1 alter column ID counter(333,5)
Or the following function:
Public Sub ResetAutonumber(TableName As String, AutoNumberFieldName _
As String, Start As Long, Step As Variant)
Dim cnn As Object ,str As String
Set cnn = CurrentProject.Connection
str = "ALTER TABLE " & TableName & " ALTER COLUMN " & _
AutoNumberFieldName & " Identity (" & Start & "," & Step & ")"
cnn.Execute str
End Sub
K.P. MVP, Poland
www.access.vis.pl