473,508 Members | 2,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HOW DO I RESENT AUTO-NUMBERING TO 1 (ONE)?

I have written a database with auto-numbering and now wish to remove alkl of
my test data and set the auto-numbering back to one. How do I do this
please?

Charles McCaffery.
Nov 12 '05 #1
5 4597
Delete the data, the Compact the database.

--
Scott McDaniel
CS Computer Software
www.thedatabaseplace.net

"Charles McCaffery" <ch**************@tiscali.co.uk> wrote in message
news:3f**********@mk-nntp-2.news.uk.tiscali.com...
I have written a database with auto-numbering and now wish to remove alkl of my test data and set the auto-numbering back to one. How do I do this
please?

Charles McCaffery.

Nov 12 '05 #2


Many thanks. I will try that.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
wat if i'd like the autonumbering to start (begin) from a a particular
number. Is there any way to do it ?

Best Rgds,
Prakash


"Scott McDaniel" <scott@NOSPAM__thedatabaseplace.net> wrote in message news:<7P********************@comcast.com>...
Delete the data, the Compact the database.

--
Scott McDaniel
CS Computer Software
www.thedatabaseplace.net

"Charles McCaffery" <ch**************@tiscali.co.uk> wrote in message
news:3f**********@mk-nntp-2.news.uk.tiscali.com...
I have written a database with auto-numbering and now wish to remove alkl

of
my test data and set the auto-numbering back to one. How do I do this
please?

Charles McCaffery.

Nov 12 '05 #4
On 13 Oct 2003 13:06:51 -0700, si****@omantel.net.om (Prakash Wadhwani) wrote:
wat if i'd like the autonumbering to start (begin) from a a particular
number. Is there any way to do it ?

Best Rgds,
Prakash


Clear the data of any existing records.
Append a single record to the table with the a value one less than your start number. You must use an append query to do this.
Compact the database.
Delete the temporary record.
The first record entered will have an autonumber value equal to your start value.

That said it is very bad practice to use an autonumber to control sequential numbering as you will quickly develope gaps in the numbering sequence.
eg If a use starts a new record but presses escape and does not the complete the record, the autonumber assigned to the new record will be discarded
and NOTreused. Therefore the next new record created will NOT be in sequence.

A far better solution is to use a Long Integer field and use Nz(DMax("MyID","tblMyTable"))+1 to determine the next available sequential number.
If you want to set a specific starting number using this method, set the last argument of the Nz function to one less than your starting number. eg to
start at 1000 use Nz(DMax("MyID","tblMyTable"),999)+1
If the new record is the first record entered in the table, 1000 will be assigned, From then on the value will increment by 1.
Wayne Gillespie
Gosford NSW Australia
Nov 12 '05 #5
I've never used auto-numbering before but was planning on using it in
one of my teeny-weeny apps next month. Thx for the warning ... I'll
certainly use your DMax alternative. I also prefer having FULL control
on the incremental processs.

Thx & Best Rgds
Prakash.

Wayne Gillespie <be*****@NObestfitsoftwareSPAM.com.au> wrote in message news:<uu********************************@4ax.com>. ..
On 13 Oct 2003 13:06:51 -0700, si****@omantel.net.om (Prakash Wadhwani) wrote:
wat if i'd like the autonumbering to start (begin) from a a particular
number. Is there any way to do it ?

Best Rgds,
Prakash


Clear the data of any existing records.
Append a single record to the table with the a value one less than your start number. You must use an append query to do this.
Compact the database.
Delete the temporary record.
The first record entered will have an autonumber value equal to your start value.

That said it is very bad practice to use an autonumber to control sequential numbering as you will quickly develope gaps in the numbering sequence.
eg If a use starts a new record but presses escape and does not the complete the record, the autonumber assigned to the new record will be discarded
and NOTreused. Therefore the next new record created will NOT be in sequence.

A far better solution is to use a Long Integer field and use Nz(DMax("MyID","tblMyTable"))+1 to determine the next available sequential number.
If you want to set a specific starting number using this method, set the last argument of the Nz function to one less than your starting number. eg to
start at 1000 use Nz(DMax("MyID","tblMyTable"),999)+1
If the new record is the first record entered in the table, 1000 will be assigned, From then on the value will increment by 1.
Wayne Gillespie
Gosford NSW Australia

Nov 12 '05 #6

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

Similar topics

2
2588
by: Manlio Perillo | last post by:
Hi. This post follows "does python have useless destructors". I'm not an expert, so I hope what I will write is meaningfull and clear. Actually in Python there is no possibility to write code...
1
34284
by: Lew | last post by:
Hi all, I'm trying to create a page that has a user-selectable page auto-refresh option (IE 5.5). Essentially, it's a page that contains a checkbox, when the user checks the checkbox, I'd like...
1
13941
by: Glabbeek | last post by:
I'm changing the layout of my site. Instead of using tables, I will use DIVs. It's working fine, except for 1 thing: In IE6 some DIVs are not the correct width. Mozilla and Opera are showing the...
20
2833
by: Vijay Kumar R. Zanvar | last post by:
Hello, Unlike register, auto keyword can not be used to declare formal parameter(s). Is there any specific reason for this? Kind regards, Vijay Kumar R. Zanvar
5
5030
by: Samuel | last post by:
Hi, I am running into a problem of mixing UICulture = auto and allowing users to select culture using a dropdown list. I am detecting a querystring, "setlang", and when found, setting the...
5
3247
by: maya | last post by:
at work they decided to center divs thus: body {text-align:center} #content {width: 612px; text-align:left; margin: 0 auto 0 auto; } this works fine in IE & FF, EXCEPT in FF it doesn't work if...
22
3034
by: nospam_news | last post by:
I currently get asked about my usage of "auto". What is it for? The keyword is clearly superflous here. In contrast to the huge majority of C/C++ developers I write definitions very explicitly...
2
3047
by: Piotr K | last post by:
Hi, I've encountered a strange problem with Firefox which I don't have any idea how to resolve. To the point: I've <divelement with a style "height: auto" and I want to retrieve this value...
1
2961
by: neridaj | last post by:
Hello, I've found a few postings of this problem but none of the answers seem to fix my problem. I have a content div wrapped around a left floated image and a right floated table. I want the...
1
5144
by: pravinnweb | last post by:
can anyone tell me how to set auto height to outer div that is in green box id "gray-background" it should increase relatively to inner div "smbox" here is the css and html code it should work in...
0
7223
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
7115
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
7377
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...
1
7036
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...
0
7489
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
5624
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,...
1
5047
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...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.