473,398 Members | 2,427 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,398 software developers and data experts.

How to I make my Autonumber field always begin with 1?

I have figured out that there is no easy way to create an autonumber field in a query, but that there is a way (supposedly) to create an autonumber field in a table or rather, there is already an autonumber field (the ID field). Is there any way I can make this ID or autonumber field to always begin with 1 so that it acts as a sort of counter/sequential numbering field for the records I put into the table?

I am appending the records from a query of fields from another table in case that has anything to do with it.
Feb 25 '11 #1

✓ answered by TheSmileyCoder

Yes, I would normally do it in VBA. Im sure it could be done in SQL aswell, if one is more familiar with SQL.

4 2626
TheSmileyCoder
2,322 Expert Mod 2GB
Autonumber fields reset to 1 when compacting (If table is empty)

Another option is to use code to delete the table, and then recreate it (using code)
Feb 25 '11 #2
To delete the table and recreate it using code would I do that in VBA?
Feb 25 '11 #3
TheSmileyCoder
2,322 Expert Mod 2GB
Yes, I would normally do it in VBA. Im sure it could be done in SQL aswell, if one is more familiar with SQL.
Feb 25 '11 #4
I figured it out, thanks! ................
Feb 25 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jan Hendrickx | last post by:
Hi all, I use (something like) following code to add new records to a database, but it doesn't work!!! I need to know the value of an AutoNumber-field when I add the record. Why doesn't it...
3
by: ben.werdmuller | last post by:
Hi, Is there an easy way in ASP/VBscript to grab an autonumber (primary key) field just after an SQL insert? This is probably easy, but I'm stuck .. Cheers.
1
by: S. van Beek | last post by:
Dear reader, By append a new record to a table I always expect the next higher value in the range of the autonumber field. But sometimes if I have deleted same records from a table the...
5
by: marko | last post by:
I would like my autonumber field to start at 100000. How can i do that?
6
by: HS1 | last post by:
Hello I have a table in Access Database. This table has a AutoNumber field. I use a DataGrid to show that table When I insert a new record in for this table using a DataGrid, there is a...
9
by: minjie | last post by:
I need to upgrade a MS Access database (Version 2002) with a script only, i.e., via SQL statement, not via Access GUI, and I'm having trouble defining an AutoNumber field. I got an exception error...
1
by: gtwannabe | last post by:
I'm having a problem with a form that uses AutoNumber as the primary key. I have an Abort button to delete the current record and close the form. If AutoNumber is assigned, the code executes a...
7
by: jmar | last post by:
I'm hoping someone out there can give me a little guidance. I have an Access Database "Customer.MDB" with a table "CustInfo" that has the following design: Field: DataType CustID AutoNumber...
2
by: Richard Sherratt | last post by:
I've inherited a system that was designed by someone with no understanding of database design. From the logical design point of view, there is no logical design. The physical design is a nightmare....
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.