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
|
|||
|
|||
Access AutoNumber Feature
Is there a way to get the AutoNumber feature in Access to
begin incrementing at a number other than 1? For example, to begin the numbers assigned to a customer ID field at 4001 instead of 1. The AutoNumber field would then generate 4001,4002,4003,4004, etc for each successive field. Thanks in advance! |
#2
|
|||
|
|||
Access AutoNumber Feature
Simplest approach is to programmatically add a record 1 less than you want,
and then delete it. Provided you do not compact before records are added, they will begin where you want. Details: Set AutoNumbers to start from ... at: http://allenbrowne.com/ser-26.html In Access 2000 and later, it is possible to achieve the same result by setting the Seed property of the automumber column using ADOX code. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Keith Davis" wrote in message ... Is there a way to get the AutoNumber feature in Access to begin incrementing at a number other than 1? For example, to begin the numbers assigned to a customer ID field at 4001 instead of 1. The AutoNumber field would then generate 4001,4002,4003,4004, etc for each successive field. Thanks in advance! |
#3
|
|||
|
|||
Access AutoNumber Feature
Although Allen is indeed correct, there is a simpler way. All you need
to do is run an INSERT query on a new, blank table with AN that will put 4000 into the AN field: INSERT INTO MyTable (myAutoNumber) VALUES (4000) Pavel Keith Davis wrote: Is there a way to get the AutoNumber feature in Access to begin incrementing at a number other than 1? For example, to begin the numbers assigned to a customer ID field at 4001 instead of 1. The AutoNumber field would then generate 4001,4002,4003,4004, etc for each successive field. Thanks in advance! |
#4
|
|||
|
|||
Access AutoNumber Feature
Thanks for the help Pavel. Could you point me in the
direction of where I could find information in performing an Insert Query? Is this the same as an Append or Update query? -----Original Message----- Although Allen is indeed correct, there is a simpler way. All you need to do is run an INSERT query on a new, blank table with AN that will put 4000 into the AN field: INSERT INTO MyTable (myAutoNumber) VALUES (4000) Pavel Keith Davis wrote: Is there a way to get the AutoNumber feature in Access to begin incrementing at a number other than 1? For example, to begin the numbers assigned to a customer ID field at 4001 instead of 1. The AutoNumber field would then generate 4001,4002,4003,4004, etc for each successive field. Thanks in advance! . |
#5
|
|||
|
|||
Access AutoNumber Feature
Insert is actually what the Access query designer calls Append. All you
have to do is click on Create new query, cancel the table selection dialog that comes up, then right-click and choose "SQL view". Type the statement you need and press the [!] on the tool bar to run the query. Make sure that you replace [myAutoNumber] in my suggestion with the name of your field (I guess it would be CustomerID or something like that). Pavel Keith Davis wrote: Thanks for the help Pavel. Could you point me in the direction of where I could find information in performing an Insert Query? Is this the same as an Append or Update query? -----Original Message----- Although Allen is indeed correct, there is a simpler way. All you need to do is run an INSERT query on a new, blank table with AN that will put 4000 into the AN field: INSERT INTO MyTable (myAutoNumber) VALUES (4000) Pavel Keith Davis wrote: Is there a way to get the AutoNumber feature in Access to begin incrementing at a number other than 1? For example, to begin the numbers assigned to a customer ID field at 4001 instead of 1. The AutoNumber field would then generate 4001,4002,4003,4004, etc for each successive field. Thanks in advance! . |
Thread Tools | |
Display Modes | |
|
|