From: Duncs on 8 Apr 2010 06:20 I have a table with data in it, whihc now needs to have a unique ID added to each record. The ID must start at 2000000 and increment by 1 for each record. Can I achieve this, and if so how? Many TIA Duncs
From: KenSheridan via AccessMonster.com on 8 Apr 2010 07:09 I'd suggest first adding an autonumber column, and a long integer number column to the table. The autonumber will be filled automatically. Check that it starts with 1 and increments by 1, and if so execute an update query, updating the long integer number column to: [YourAutonumberColumn]+1999999 You can then delete the autonumber column from the table and make the long integer number column its primary key, or otherwise index it uniquely and set its Required property to True (Yes). To increment the long integer number column for subsequent new records Roger Carlson has simple methods for generating custom 'autonumbers' in either a single or multi-user environment at: http://www.rogersaccesslibrary.com/forum/topic395.html Or my slightly more complex method at: http://community.netscape.com/n/pfx/forum.aspx?nav=libraryMessages&tsn=1&tid=23839&webtag=ws-msdevapps allows the next number to be generated to be reseeded at any time. Ken Sheridan Stafford, England Duncs wrote: >I have a table with data in it, whihc now needs to have a unique ID >added to each record. The ID must start at 2000000 and increment by 1 >for each record. > >Can I achieve this, and if so how? > >Many TIA > >Duncs -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access/201004/1
From: Duncs on 27 Apr 2010 08:14 Ken, Sorry for the unreasonable delay in replying to you. I tried your suggestion and it works a treat for me. It also gives me a bit more scope to do some otheer things with the data. Cheers Duncs On 8 Apr, 12:09, "KenSheridan via AccessMonster.com" <u51882(a)uwe> wrote: > I'd suggest first adding an autonumber column, and a long integer number > column to the table. The autonumber will be filled automatically. Check > that it starts with 1 and increments by 1, and if so execute an update query, > updating the long integer number column to: > > [YourAutonumberColumn]+1999999 > > You can then delete the autonumber column from the table and make the long > integer number column its primary key, or otherwise index it uniquely and set > its Required property to True (Yes). To increment the long integer number > column for subsequent new records Roger Carlson has simple methods for > generating custom 'autonumbers' in either a single or multi-user environment > at: > > http://www.rogersaccesslibrary.com/forum/topic395.html > > Or my slightly more complex method at: > > http://community.netscape.com/n/pfx/forum.aspx?nav=libraryMessages&ts.... > > allows the next number to be generated to be reseeded at any time. > > Ken Sheridan > Stafford, England > > Duncs wrote: > >I have a table with data in it, whihc now needs to have a unique ID > >added to each record. The ID must start at 2000000 and increment by 1 > >for each record. > > >Can I achieve this, and if so how? > > >Many TIA > > >Duncs > > -- > Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/access/201004/1
|
Pages: 1 Prev: <Kein Betreff> Next: How to start and Access DB from a bat-file |