473,406 Members | 2,847 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,406 software developers and data experts.

Over-riding autonum

Thanks for the help before I even start...

I'm working in Access and I have right now 1024 records. We have a field
set to Autonum that gives each new record a new file number. The
problem? We have had a number of records deleted and even though our
file number is up to 1033, we only have 1024 records.

I need to know how to fill in the gaps (have 1033 records and 1033 files
(data can be filled in later)) without screwing up the order of the file
numbers. I know this is a long and complicated process and there is no
real reason to do so but I have a boss who doesn't understand this and
just wants things to look pretty.

I'm almost there but I think I'm doing it wrong, so any help would be
appreciated. Thanks again.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
3 1517
I don't think you will succeed. Autonumber is designed not to reuse numbers. Why
not add another field called FileNum to your table and make it consecutive. When
you add a new record increment FileNum By:
Me!FileNum = DMax("[FileNum]","NameOfTable") + 1

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Jen LaForge" <je**************@fairmont.com> wrote in message
news:40**********************@news.newsgroups.ws.. .
Thanks for the help before I even start...

I'm working in Access and I have right now 1024 records. We have a field
set to Autonum that gives each new record a new file number. The
problem? We have had a number of records deleted and even though our
file number is up to 1033, we only have 1024 records.

I need to know how to fill in the gaps (have 1033 records and 1033 files
(data can be filled in later)) without screwing up the order of the file
numbers. I know this is a long and complicated process and there is no
real reason to do so but I have a boss who doesn't understand this and
just wants things to look pretty.

I'm almost there but I think I'm doing it wrong, so any help would be
appreciated. Thanks again.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #2
Jen LaForge wrote:
Thanks for the help before I even start...

I'm working in Access and I have right now 1024 records. We have a field
set to Autonum that gives each new record a new file number. The
problem? We have had a number of records deleted and even though our
file number is up to 1033, we only have 1024 records.


Autonumbers are very useful as keys for a table. I would never use them
for a sequential number. In fact, most people make autonumber fields
invisible. Why give something to a user to confuse them further. Do
you go through and count each record and look for gaps? If you have a
gap, do you REALLY care? Do you search/access your records by
autonumbers? Do you have a REAL need to show users an autonumber? If
not, open up the property sheet for it and hide it by setting the
visible property to NO under the Format tab.

Nov 13 '05 #3
Jen, I agree with the other post whole heartedly, however if you really,
really, really feel the need to do this there is a way. Open your table in
design view. Select File/Save As from the main menu. Rename the table. Now
design a new query using the original table as the record source for the
query. Add all the fields to the design grid. Select Query/Append Query
from the main menu. Select the new table you just created as the
destination table. Now all of the Append To fields should match each other
in the design grid. Under the Autonumber field delete the Append To field
so that it is blank. Sort your records Ascending for the Autonumber field.
Run the query. Check the new table to ensure the results are what you want.
If so you can delete the original table and rename this table to the
original tables name. Keep in mind the next time you delete a single
record, your numbers will be off again. I still think you should re-think
your reasoning and/or convince your boss to see the light. Hope it helps.

--
Reggie

www.smittysinet.com
----------
"Salad" <oi*@vinegar.com> wrote in message
news:hb*******************@newsread1.news.pas.eart hlink.net...
Jen LaForge wrote:
Thanks for the help before I even start...

I'm working in Access and I have right now 1024 records. We have a field
set to Autonum that gives each new record a new file number. The
problem? We have had a number of records deleted and even though our
file number is up to 1033, we only have 1024 records.


Autonumbers are very useful as keys for a table. I would never use them
for a sequential number. In fact, most people make autonumber fields
invisible. Why give something to a user to confuse them further. Do
you go through and count each record and look for gaps? If you have a
gap, do you REALLY care? Do you search/access your records by
autonumbers? Do you have a REAL need to show users an autonumber? If
not, open up the property sheet for it and hide it by setting the
visible property to NO under the Format tab.

Nov 13 '05 #4

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

Similar topics

7
by: rdh | last post by:
Hi all, I am in process of developing a Server in C++ supporting multiple protocols. The server will be exposing various functionalities, and the clients can communicate over any of the...
2
by: Matt | last post by:
here's some more code i inherited on a project: function set_background(pic){ if(pic==""){ if(ie4)over.backgroundImage="none"; if(ns6)over.style.backgroundImage="none"; }else{ if(ns4){...
5
by: Paul Reddin | last post by:
Hi, using ROWNUMBER() is affecting the plan of a view very badly... is there a way of writing the following view to ensure rownumber() is done as the last thing done? i.e after the calling...
56
by: Raphi | last post by:
Hi, I've been using an Access application I wrote for an office with the front-end stored on all computers and the back-end on one of them serving as an Access file server. Now we're moving...
6
by: news | last post by:
I need some concise, easy to grok examples of what .Net (preferably C#.Net) has over just using old ASP or PHP with JavaScript. See, I'm a PHP guy, and while I started server-side scripting with...
3
by: Sebastian | last post by:
Hello all I have a report where I have two nested groups. I know there are only three standard options for running sum: None, Over Group and Over All. I have a MyTextBox in detail section where...
3
by: Andrew 2006 | last post by:
Hi there, I'm trying to understand the differences between sending XML over TCP and XML over HTTP (SOAP). However I'm not having much luck finding good articles on the www. Can anyone...
5
by: Jonathan Kay | last post by:
Hi, I'd like to my WCF webservice to work both on SSL and without. Unfortunately searching has led to dead ends, references to changes that only work on the old previous beta versions and I...
4
cassbiz
by: cassbiz | last post by:
Could use some help here. This script is carrying over an image just fine but the text isn't coming over. can you see why it is not working???? from the form I want to carry over two lines of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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
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
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...

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.