473,385 Members | 1,464 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,385 software developers and data experts.

inserting into a table with AutoNumber

Is there a way to restart the auto numbering count after a delete operation? I'm trying to delete and insert new records based on another table, and I want the first record of the table to be numbered 1, the second numbered 2, etc.
Sep 24 '07 #1
1 1023
I think the only way you can re-zero an auto-number field is to delete all the records in the relevant table and compact the db.

A solution that springs to mind is that you could create a new table each time you delete an autonumbered record, append all your current recordset into that, minus the existing autonumber, then delete the old table, rename the new table and so on. Seems risky though.

There's loads of info on forums about autonumbers including this one, with suggestions for other ways to get incremental numbering, worth googling a bit.

Sorry this hasn't been very helpful!
Sep 25 '07 #2

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

Similar topics

21
by: Dan | last post by:
Hi, just ran into my first instance of a backend Access97 database not compacting. I'm getting the "MSACCESS.EXE has generated errors.." message on compact. I've narrowed it down to the largest...
33
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
3
by: Chris Dixon | last post by:
I am using a SQL Server 7 databaes with an Access 2000 front-end. I have a form where after the user inserts a record the screen refreshes to display a completely different record (without any...
5
by: jonhanks | last post by:
I'm trying to copy a table and its structure from DBase into Access. One of the fields is a primary key and contains numbers from 0 to 20000 and then from 30000 to 40000. How can I make this...
1
by: Karen Hill | last post by:
I have a two value table where the first field is an autonumber. I wrote an SQL statement in visual basic for applications to insert but it fails. This is the code: DoCmd.RunSQL "INSERT INTO...
4
by: Bruno Alexandre | last post by:
Hi guys, I have a web application that insert Clients info into the Database, the Apllication is accesed by several user at the same time, the Client Info is divide by 3 tables (Client, Product...
3
by: Darin | last post by:
This is something that on the surface seems like it should be simple, but I can't think of a way to do this. I have a table that is a list of "jobs", which users create and use. It has a single...
2
klarae99
by: klarae99 | last post by:
Hello, I am working in Access 2003 to create a database to record information about an annual fundraiser. I was hoping someone could review my table structure and make sure that it is normalized...
6
by: ashes | last post by:
Hi, I am creating an ecommerce website using Microsoft Visual Studio, VB.Net and MS Access 2003. I am new to VB.Net When someone wants to register on the website, they fill out a form and the...
1
by: Arli | last post by:
I have the following linked tables: tblMainPL is my main table that I need to pull the information in from. It has the following fields: Autonumber1 -PK set as autonumber Date - short date...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.