473,748 Members | 4,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reset Auto Number Fields

I apologize if this question has been asked before...

I'm trying to reset autonumber fields back to 1. The autonumber fields are
part of the composite primary keys.

I followed the MS help with a temp table and append query. I can change the
number to anything but 1. I'm using Access XP and saving as 2000.

Any help is appreciated.
Nov 13 '05 #1
3 11241
The AutoNumber should reset if you delete all the data from the tables, and
then compact the database:
Tools | Database Utitlities | Compact

If it does not do that, you probably need the JET 4 service pack from:
http://support.microsoft.com/gp/sp

If you want to programmaticall y examine whether your tables have bad
autonumbers, you can use this link:
http://allenbrowne.com/ser-40.html
and you could use the technique described in that article to reset the Seed
of your AutoNumber.

--
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.

"trueblue7" <kp*********@cf l.rr.com> wrote in message
news:NF******** *********@torna do.tampabay.rr. com...
I apologize if this question has been asked before...

I'm trying to reset autonumber fields back to 1. The autonumber fields are
part of the composite primary keys.

I followed the MS help with a temp table and append query. I can change
the number to anything but 1. I'm using Access XP and saving as 2000.

Any help is appreciated.

Nov 13 '05 #2
Thanks, it worked. It would have saved be a lot of time if that information
would have been included in the help.

"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:43******** *************** @per-qv1-newsreader-01.iinet.net.au ...
The AutoNumber should reset if you delete all the data from the tables,
and then compact the database:
Tools | Database Utitlities | Compact

If it does not do that, you probably need the JET 4 service pack from:
http://support.microsoft.com/gp/sp

If you want to programmaticall y examine whether your tables have bad
autonumbers, you can use this link:
http://allenbrowne.com/ser-40.html
and you could use the technique described in that article to reset the
Seed of your AutoNumber.

--
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.

"trueblue7" <kp*********@cf l.rr.com> wrote in message
news:NF******** *********@torna do.tampabay.rr. com...
I apologize if this question has been asked before...

I'm trying to reset autonumber fields back to 1. The autonumber fields
are part of the composite primary keys.

I followed the MS help with a temp table and append query. I can change
the number to anything but 1. I'm using Access XP and saving as 2000.

Any help is appreciated.


Nov 13 '05 #3
>I'm trying to reset autonumber fields back to 1. The autonumber fields
are part of the composite primary keys.

I had the opposite problem -- preventing autonumber from resetting to 1
after compact and repair. It automatically resets to 1 if there is no
data in the table.

I use autonumber for generating invoice numbers -- OK I know I shouldn't,
but I wasn't aware of the reasons when I started.

As a batch of invoice numbers have been generated and invoices sent I
delete the invoice numbers from the table.

Having once done a compact and repair and lost my numbering, I now make
sure there is one invoice number in the table at all times. That way,
when I compact and repair, my numbering is preserved.

Malcolm Webb
Nov 13 '05 #4

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

Similar topics

2
12717
by: Tom | last post by:
I am trying to store information into a table that has an auto increment field. There is currently no data in the table. Using the code below I cannot insert data into the table. I get an error telling me that "Number of query values and destination fields are not the same." If I add a value for the auto increment field to the SQL String the data is entered into the table with no problems but obviously the auto increment field now...
0
5868
by: Earl Anderson | last post by:
KB Article Q140908 provided the following function to create an Auto Incrementing Counter: Function Next_Custom_Counter () On Error GoTo Next_Custom_Counter_Err Dim MyDB As Database Dim MyTable As Recordset Dim NextCounter As Long
12
23775
by: deko | last post by:
Is there a way to reset the AutoNumber sequence? I have several tables that use the AutoNumber field as the Primary Key, and I'd like to somehow do an Import/Export that will make remove the breaks in the sequence. A few breaks in sequence is not a big deal, but I have one table with under 200 records, but the last AutoNumber PK ID field is over 1500 - due to a lot of edits....
16
20524
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number can go without the system crashing. An ancillary question is how one resets an auto number so that the sequence starts again at 1. In the case of this file, the auto number field serves no useful purpose except as an
13
4728
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when i type in the details. I have just moved over to mysql server with access as the front end. I have setup the sql tables with the customer number as autonumber. When i go into the form and add a new customer it does not generate the
2
2842
by: DeanO | last post by:
I am trying to set my autonumber field to reset automatically at the beginning of each new year. This is a three digit field and is used with the date for a report number field. The number is currently set to auto fill and looks like this 00/00/0000-000. I want the last three digits to reset with the new year date field. Both fields are hidden and combine in the report number text box.
8
12513
by: Wayne L | last post by:
I have searched and could not find my solution to my problem. I have a table that has a field that I want to start at 0001 and go to 1999. Once it reaches 1999 I want the field to reset to 0001. I am importing unique records and the date and number separates the records but some days there may be more than one import. So if I set the field to auto number and compact and repair on exiting I have the possibility of duplicating the same date...
3
2175
by: Wayne L | last post by:
Ok now everyone has mentioned not to use auto number if it means anything to the user. My application uses the auto number for exporting only. I append the mastertbl column with my starting number of 0001(4 digits) (prior to populating the table). When information is imported and appended via a query to the mastertbl it will start with 0002 and increment. All tables used are cleared with a delete query after being exported, this allows the...
2
4742
by: paulyXvpf | last post by:
Hi All, FACTS: > I've created a VB.NET 2005 form, with a SQL Server 2000 backend > The form has about 30 fields that populate 30 columns in the SQL database > The form has mostly text feilds, with standard info such as Customer, order Number, etc. > Im trying to autopopulate one of the feilds on the form, called Reference Number. > The SQL column on the backend auto increments fine > The Reference Numbercolumn has identity...
0
9544
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9372
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3313
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
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.