If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
autonum keyfield
I was worrking with a clients db and without going into details, they issued
2 new records in a table then I restored it. I need to put these records in and generate 2 new records in a table with autonum field. There are 2 "open" places for the records but I don't if it's possible to force add them and PUT IN THE NUMBER I WANT? Can anyone tell me if this can be done? ie. NUM existing 100 104 105 can I force 102 and 103? THANKS WWV |
#2
|
|||
|
|||
On Sun, 21 Nov 2004 15:56:37 -0500, "WWV" wrote:
I was worrking with a clients db and without going into details, they issued 2 new records in a table then I restored it. I need to put these records in and generate 2 new records in a table with autonum field. There are 2 "open" places for the records but I don't if it's possible to force add them and PUT IN THE NUMBER I WANT? Can anyone tell me if this can be done? ie. NUM existing 100 104 105 can I force 102 and 103? By NOT using an Autonumber. An Autonumber field has one purpose, and one purpose ONLY: to provide a guaranteed-unique key. Autonumbers are intentionally NOT editable or controllable. If you care what the value is, or want to see it, you should use a Long Integer field instead, and maintain its value manually or in VBA code. John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
#3
|
|||
|
|||
In the Table Design change the Autonum field to a Long Integer, make the
changes you want in the field values, change back to AutoNum. "WWV" wrote: I was worrking with a clients db and without going into details, they issued 2 new records in a table then I restored it. I need to put these records in and generate 2 new records in a table with autonum field. There are 2 "open" places for the records but I don't if it's possible to force add them and PUT IN THE NUMBER I WANT? Can anyone tell me if this can be done? ie. NUM existing 100 104 105 can I force 102 and 103? THANKS WWV |
#5
|
|||
|
|||
In the Table Design change the Autonum field to a Long Integer, make the
changes you want in the field values, change back to AutoNum. Glen, That won't work. Attempting to change the field back to AutoNumber will generate the following error: "Once you enter data in a table, you can't change the data type of any field to AutoNumber, even if you haven't yet added data to that field." -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm "Glen Bodie" Glen wrote in message ... In the Table Design change the Autonum field to a Long Integer, make the changes you want in the field values, change back to AutoNum. "WWV" wrote: I was worrking with a clients db and without going into details, they issued 2 new records in a table then I restored it. I need to put these records in and generate 2 new records in a table with autonum field. There are 2 "open" places for the records but I don't if it's possible to force add them and PUT IN THE NUMBER I WANT? Can anyone tell me if this can be done? ie. NUM existing 100 104 105 can I force 102 and 103? THANKS WWV |
#6
|
|||
|
|||
John Vinson wrote in
: If you care what the value is, or want to see it, you should use a Long Integer field instead, and maintain its value manually or in VBA code. To be fair, John, I read the OP message as wanting to restore two records that had been accidentally lost. If the autonumber has been propagated onto other records (eg paper forms, remote database, spreadsheet etc) then it's reasonable to want to put them back as they were. It's not necessarily a cosmetic don't-want-gaps-in-the-numbers scenario. B Wishes Tim F |
#7
|
|||
|
|||
On Wed, 24 Nov 2004 09:32:18 -0800, Tim Ferguson
wrote: John Vinson wrote in : If you care what the value is, or want to see it, you should use a Long Integer field instead, and maintain its value manually or in VBA code. To be fair, John, I read the OP message as wanting to restore two records that had been accidentally lost. If the autonumber has been propagated onto other records (eg paper forms, remote database, spreadsheet etc) then it's reasonable to want to put them back as they were. It's not necessarily a cosmetic don't-want-gaps-in-the-numbers scenario. Good point Tim! I wasn't thinking the question through and just dropped into autopilot. John W. Vinson[MVP] Join the online Access Chats Tuesday 11am EDT - Thursday 3:30pm EDT http://community.compuserve.com/msdevapps |
Thread Tools | |
Display Modes | |
|
|