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

AutoNumber

I made a database and tested it a few times.
I now wnat to use it in production.
I deleted all the test data.
Is there a way to tell it to start autonumbering from 1 or am I stuck
with like 29 that was from testing the database 28 times.

Thanks in advance
Sep 29 '06 #1
6 1702
On Fri, 29 Sep 2006 19:16:42 -0400, Dr. Edmund M. Hayes wrote:
I made a database and tested it a few times.
I now wnat to use it in production.
I deleted all the test data.
Is there a way to tell it to start autonumbering from 1 or am I stuck
with like 29 that was from testing the database 28 times.

Thanks in advance
After you delete the data in the table(s) (not the tables themselves),
compact the database.
Tools + Database Utilities + Compact and Repair

Note. While this will re-set the autonumber to 0, it really shouldn't
matter what value the number is, as long as it is unique.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 29 '06 #2
On Fri, 29 Sep 2006 19:16:42 -0400, Dr. Edmund M. Hayes <ed@edhayes.comwrote:
>I made a database and tested it a few times.
I now wnat to use it in production.
I deleted all the test data.
Is there a way to tell it to start autonumbering from 1 or am I stuck
with like 29 that was from testing the database 28 times.

Thanks in advance
Once you have deleted all data from the table, compact the datafile. The
Autonumber will be reset and start at 1.

However, if the number generated by the Autonumber is important and needs to be
sequential, then you should not be using an autonumber. The A/N sequence will
get gaps overtime.
Wayne Gillespie
Gosford NSW Australia
Sep 29 '06 #3

Dr. Edmund M. Hayes wrote:
I made a database and tested it a few times.
I now wnat to use it in production.
I deleted all the test data.
Is there a way to tell it to start autonumbering from 1 or am I stuck
with like 29 that was from testing the database 28 times.

Thanks in advance
This may help. If you deleted the test data. Open the table in design
mode. copy the field name for Autonumber. deleted save the table.
create the same autonumber field with the name and properties. It
should begin again at "1".

Hope this helps, its simple.

loringdo

Sep 30 '06 #4
loringdo wrote:
Dr. Edmund M. Hayes wrote:
I made a database and tested it a few times.
I now wnat to use it in production.
I deleted all the test data.
Is there a way to tell it to start autonumbering from 1 or am I stuck
with like 29 that was from testing the database 28 times.
If you need anything more robust than what can be accomplished by
compacting, check the Access Security FAQ, section 3.11. It discusses
the Modify Autonumber permission that can be set via DAO. I've never
used this, but it can be done.

Sep 30 '06 #5
Thanks again for the help.............

Ed

On Fri, 29 Sep 2006 19:16:42 -0400, Dr. Edmund M. Hayes
<ed@edhayes.comwrote:
>I made a database and tested it a few times.
I now wnat to use it in production.
I deleted all the test data.
Is there a way to tell it to start autonumbering from 1 or am I stuck
with like 29 that was from testing the database 28 times.

Thanks in advance
Sep 30 '06 #6

"Dr. Edmund M. Hayes" <ed@edhayes.comwrote in message
news:s5********************************@4ax.com...
>I made a database and tested it a few times.
I now wnat to use it in production.
I deleted all the test data.
Is there a way to tell it to start autonumbering from 1 or am I stuck
with like 29 that was from testing the database 28 times.
Autonumbers are only guaranteed to be "unique," not to be any particular
number, and are intended to be used only internally for identification/keys,
foreign keys, and joins, so you should not have any need to reset them
(though others have told you how). They are NOT intended for presentation /
showing to users. If you have need of a sequential,
monotonically-increasing number to present to users, you can create it one
of several ways, the DMAX domain aggregate function being a common one.

Larry Linson
Microsoft Access MVP
Sep 30 '06 #7

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

Similar topics

3
by: Ilan Sebba | last post by:
I have a 'supertype' table with only one field: autonumber. Call this table the 'parent' table. There are two subtypes, 'androids' and 'martians'. Martian have only one thing in common: they give...
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...
35
by: Traci | last post by:
If I have a table with an autonumber primary key and 100 records and I delete the last 50 records, the next record added would have a primary key of 101. Is there any way to have the primary key...
4
by: yf | last post by:
A KB article "http://support.microsoft.com/default.aspx?scid=kb;en-us;209599" tells that the maximum number of records that a table may hold if the PRIMARY key data type is set to AUTONUMBER is...
26
by: jimfortune | last post by:
Sometimes I use Autonumber fields for ID fields. Furthermore, sometimes I use those same fields in orderdetail type tables. So it's important in that case that once an autonumber key value is...
8
by: petebeatty | last post by:
I have created a SQL string the properly inserts a record in the table. However, the insert does not occur at the end of the table. Instead it inserts a record after the last record that I viewed....
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
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...
9
by: Tom_F | last post by:
To comp.databases.ms-access -- I just discovered, to my more than mild dismay, that some tables in my Microsoft Access 2003 database have duplicate numbers in the "AutoNumber" field. (Field...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
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
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...
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,...

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.