[AccessD] Resetting Autonumber seed

Robin Robin at rolledgold.net
Wed May 10 10:01:35 CDT 2006


Using Access 97 - found this example but keep getting syntax error ...
 
Don't want to use ADOX because of references ....
 
Sub testit()
Dim lngordnomax As Long, strsql As String
lngordnomax = DMax("OrdOrderID", "PostedOrders", "OrdOrderID>0")
        lngordnomax = lngordnomax + 1
        strsql = "ALTER TABLE [Orders] ALTER Column [OrdOrderID] Counter
(" & lngordnomax & ",1)"
        CurrentDb.Execute strsql
End Sub
 
Can anyone advise what the problem may be
 
Rgds
Robin Lawrence
 



More information about the AccessD mailing list