Mark A Matte
markamatte at hotmail.com
Wed May 10 13:01:32 CDT 2006
Robin, Just to clarify...you are trying to reset the autonumber field...so if your have records 1-10...then delete 5-10...the next number will be 11 even though 10 has been deleted. In this example...you want the next number to be 6? Thanks, Mark >From: "Robin " <Robin at rolledgold.net> >Reply-To: Access Developers discussion and problem >solving<accessd at databaseadvisors.com> >To: "Access Developers discussion and problem >solving"<accessd at databaseadvisors.com> >Subject: Re: [AccessD] Resetting Autonumber seed >Date: Wed, 10 May 2006 18:28:30 +0100 > >Gustav, >Read a bit further through this and this is exactly what I need - > >Both the seed and the increment can be modified using an ALTER TABLE >statement. New records inserted into the table will have values that are >automatically generated for the field based on the new seed and >increment values. If the new seed and increment can yield new values >that match existing values generated by the preceding seed and >increment, duplicates will be created. If the field is a Primary Key, >then inserting new records may result in errors when duplicate primary >keys are created. >The following is an example of using the ALTER TABLE statement to set >new seed and increment values for an auto-increment field: > > ALTER TABLE TableName ALTER COLUMN FieldName SET IDENTITY (2,4) > >Are you thinking I can't do this because I'm using Acess97 ? >(I've tried sbstituting IDENTITY for COUNTER but get the same error) >Rgds >Robin >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com