473,569 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

39 New Member
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
4 2633
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
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
Amy Badgett
39 New Member
To delete the table and recreate it using code would I do that in VBA?
Feb 25 '11 #3
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
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
Amy Badgett
39 New Member
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
2824
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 work and how can I make it work??? I think it should be easy, but I can't figure it out!
3
7878
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
2412
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 behaviour of the autonumber field is changed.
5
2443
by: marko | last post by:
I would like my autonumber field to start at 100000. How can i do that?
6
6226
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 message that asks me to enter the value for this AutoNumber field. Why I have to do that? Could you please help
9
60071
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 when running the follwoing (in a C++ program using ADO): ...... cmdStr = "CREATE TABLE mytab " "( AutoNumber, " " TEXT(50), " "CONSTRAINT ...
1
3947
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 SQL statement that deletes the current record. I need to be able to detect when AutoNumber is unassigned (a new blank record) so that I can simply...
7
2980
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 Name Text Title Text Phone Text
2
2042
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. e.g. there are no relationships between tables and foreign keys appear to have been sprinkled at random like confetti. As an example, the Employer...
0
7694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5504
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.