[AccessD] Resetting Autonumber seed

Robin Robin at rolledgold.net
Wed May 10 11:37:10 CDT 2006


Thanks Marty - 
The line wrap is just in Outlook - viewing strsql gives the intended
line ...
Does anyone know if the syntax is valid - checking help in Access 97
doesn't give the "counter" option
Rgds
Robin



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of MartyConnelly
Sent: 10 May 2006 17:39
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Resetting Autonumber seed


could it be just a line wrap problem, if so try this

        strsql = "ALTER TABLE [Orders] ALTER Column [OrdOrderID] 
Counter" & _
"(" & lngordnomax & ",1)"

Robin wrote:

>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
> 
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list