473,405 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

automatically generated sequential number

New to Access here. I inherited a db that has the first column as an
automatically generated sequential number. I want to bump it up, but
for the life of me I can't figure out how to do it. Is this type of
generation a built in function of Access? I'm sure it can be written
manually, but I doubt someone took the trouble to do it...
Can someone point me in the right direction to figure out how to change
this number?
Thank you one and all!
Sam

Jan 17 '07 #1
9 5159
Check the properties of the field (right-click on the table and choose
"Design View"). If the field is set as an AutoNumber, it will
automatically generate a sequential number fo rthe next record.

Nooby wrote:
New to Access here. I inherited a db that has the first column as an
automatically generated sequential number. I want to bump it up, but
for the life of me I can't figure out how to do it. Is this type of
generation a built in function of Access? I'm sure it can be written
manually, but I doubt someone took the trouble to do it...
Can someone point me in the right direction to figure out how to change
this number?
Thank you one and all!
Sam
Jan 17 '07 #2
Thank you. It does show as AutoNumber. Now, how do I change the number
sequence? After a certain date I want to bump it up by 10,000. But
where?
Thanks!

ManningFan wrote:
Check the properties of the field (right-click on the table and choose
"Design View"). If the field is set as an AutoNumber, it will
automatically generate a sequential number fo rthe next record.

Nooby wrote:
New to Access here. I inherited a db that has the first column as an
automatically generated sequential number. I want to bump it up, but
for the life of me I can't figure out how to do it. Is this type of
generation a built in function of Access? I'm sure it can be written
manually, but I doubt someone took the trouble to do it...
Can someone point me in the right direction to figure out how to change
this number?
Thank you one and all!
Sam
Jan 18 '07 #3
You can't do that with an autonumber. You'll have to change it to a
generic number and increase it yourself through code.

Nooby wrote:
Thank you. It does show as AutoNumber. Now, how do I change the number
sequence? After a certain date I want to bump it up by 10,000. But
where?
Thanks!

ManningFan wrote:
Check the properties of the field (right-click on the table and choose
"Design View"). If the field is set as an AutoNumber, it will
automatically generate a sequential number fo rthe next record.

Nooby wrote:
New to Access here. I inherited a db that has the first column as an
automatically generated sequential number. I want to bump it up, but
for the life of me I can't figure out how to do it. Is this type of
generation a built in function of Access? I'm sure it can be written
manually, but I doubt someone took the trouble to do it...
Can someone point me in the right direction to figure out how to change
this number?
Thank you one and all!
Sam
Jan 18 '07 #4

"ManningFan" <ma********@gmail.comschreef in bericht news:11**********************@38g2000cwa.googlegro ups.com...
You can't do that with an autonumber. You'll have to change it to a
generic number and increase it yourself through code.
Well, you can actually!
Suppose you would like the autonumber to start with 100.000
Create and execute an appendquery to add the desired number -1, (99.999)
Your autonumber will be 100.000 the next record

Step by step:
Make a duplicate table with the same fields as your original table (use copy and paste on your original table)
In this table change your autonumber-field in long integer!
Add one record in this table with your desired autonumber.
Now use an appendquery to append the long integer-record from the dupe-table to the *original* table

Arno R



Jan 18 '07 #5
Yes, there are a bunch of poorly hacked ways to do it.

Arno R wrote:
"ManningFan" <ma********@gmail.comschreef in bericht news:11**********************@38g2000cwa.googlegro ups.com...
You can't do that with an autonumber. You'll have to change it to a
generic number and increase it yourself through code.

Well, you can actually!
Suppose you would like the autonumber to start with 100.000
Create and execute an appendquery to add the desired number -1, (99.999)
Your autonumber will be 100.000 the next record

Step by step:
Make a duplicate table with the same fields as your original table (use copy and paste on your original table)
In this table change your autonumber-field in long integer!
Add one record in this table with your desired autonumber.
Now use an appendquery to append the long integer-record from the dupe-table to the *original* table

Arno R
Jan 18 '07 #6

ManningFan wrote:
Yes, there are a bunch of poorly hacked ways to do it.
There's nothing "poorly hacked" about it. It's a simple matter of

INSERT INTO autonum_test ( ID )
SELECT 99999 AS ID;

DELETE autonum_test.*
FROM autonum_test
WHERE (((autonum_test.ID)=99999));

As long as you don't compact the database before the next row is added
(AutoNumber ID=100000) you're fine.
Arno R wrote:
"ManningFan" <ma********@gmail.comschreef in bericht news:11**********************@38g2000cwa.googlegro ups.com...
You can't do that with an autonumber. You'll have to change it to a
generic number and increase it yourself through code.
Well, you can actually!
Suppose you would like the autonumber to start with 100.000
Create and execute an appendquery to add the desired number -1, (99.999)
Your autonumber will be 100.000 the next record

Step by step:
Make a duplicate table with the same fields as your original table (use copy and paste on your original table)
In this table change your autonumber-field in long integer!
Add one record in this table with your desired autonumber.
Now use an appendquery to append the long integer-record from the dupe-table to the *original* table

Arno R
Jan 18 '07 #7
I am very greatful for the input. I'm afraid the solution may be above
my level of expertise.
I expected a vairable somewhere containing the most current number to
be updated.
But I will give it a try.
Thanks, all!
Sam

Gord wrote:
ManningFan wrote:
Yes, there are a bunch of poorly hacked ways to do it.

There's nothing "poorly hacked" about it. It's a simple matter of

INSERT INTO autonum_test ( ID )
SELECT 99999 AS ID;

DELETE autonum_test.*
FROM autonum_test
WHERE (((autonum_test.ID)=99999));

As long as you don't compact the database before the next row is added
(AutoNumber ID=100000) you're fine.
Arno R wrote:
"ManningFan" <ma********@gmail.comschreef in bericht news:11**********************@38g2000cwa.googlegro ups.com...
You can't do that with an autonumber. You'll have to change it to a
generic number and increase it yourself through code.
>
Well, you can actually!
Suppose you would like the autonumber to start with 100.000
Create and execute an appendquery to add the desired number -1, (99.999)
Your autonumber will be 100.000 the next record
>
Step by step:
Make a duplicate table with the same fields as your original table (use copy and paste on your original table)
In this table change your autonumber-field in long integer!
Add one record in this table with your desired autonumber.
Now use an appendquery to append the long integer-record from the dupe-table to the *original* table
>
Arno R
Jan 18 '07 #8

"Gord" <gd*@kingston.netschreef in bericht news:11**********************@m58g2000cwm.googlegr oups.com...

ManningFan wrote:
>Yes, there are a bunch of poorly hacked ways to do it.
There's nothing "poorly hacked" about it. It's a simple matter of

INSERT INTO autonum_test ( ID )
SELECT 99999 AS ID;

DELETE autonum_test.*
FROM autonum_test
WHERE (((autonum_test.ID)=99999));

As long as you don't compact the database before the next row is added
(AutoNumber ID=100000) you're fine.

Indeed, nothing 'hacked' here. (I learned this 'trick' from my first Access book)
I guess Manningfan just does not like to be corrected when he gives bad information ...

But it is a clumsy way indeed. There *should* be no need to correct an autonumber or to reset it.
We all must try not to use an autonumer as a 'meaningful' number, only as unique recordID.

Arno R
Jan 18 '07 #9
Oh Christ on a popsicle stick, it's Arno...

"Clumsy" = "Hacked". You just love to try to break my balls, don't you?

Jan 19 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jenn L | last post by:
I have a database that is pre-populated with sequential part numbers. As people reserve the parts I update a flag to show the # is no longer available. Now they want the ability to take out a...
5
by: Lapchien | last post by:
I have list of numbers in a table (originally from autonumber in a different database) from 1 to 1,000,000. The list is not in sequential order - there are loads of numbers missing. How can I...
7
by: GAVO. | last post by:
Hello every one I have a database with a form called "frmOrders" on that for I need to create a sequential number for each city apart from the original autonumber. So the table "tblorders" would...
11
by: Gary | last post by:
I'm using Access 2002. I have a field called Job No. It is a text (data type). The reason being that there is an "I" in front of each number i.e. I1234 I1235 etc The problem is that when...
2
by: jmpinto | last post by:
I have a field on a form that I would like to automatically generate a number, in sequential order, each time a new record is created, and be stored in a field. The problem is that I do not want...
2
by: anuragpj | last post by:
I want that in the number textfield a number is automatically generated, and If there is a number in the table of the database the next number is generated in the number textfield. How can I do this?
1
by: campbellbrian2001 | last post by:
I have a product inventory database with a form to enter new products. I used the wizard to add a button to save the new item upon pressing it, however I noticed that the record is saved anyway....
1
maxamis4
by: maxamis4 | last post by:
Hello folks, I have two forms a parent form and a subform. The parent form is an unbound form while the subform is a form that contains all a list of what I like to call 'in stock ' phone...
6
by: GLEberts | last post by:
Novice looking for some direction!! I am trying to have a text box autopopulate with a number added to it at the end and I am having a difficult time doing this. Example: (1) I have a combo...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.