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

Best way to re-number data in fields

stonward
145 100+
This project has been unutterably miserable; after almost a dozen retail system out there working great, this one update has stripped all the joy from software development from me: I no longer trust any part of what I thought I knew about Access! This is my last project (I have been unable to just drop it).

The system I'm trying to update let the user enter their own Invoice Number, which was also the OrderID....and, a mistake I know, a PK.

Anyhow, several thousand records in, his numbering methods change - daily it seems. I need to replace this now with an auto-incrmemting field. I ahve tried all manner of methods, but cannot seem to make anything but a mess. Has anyone come across a similar issue, or is it just me?

Please take pity on someone who promises to only make databases for my friends record collections in future.

Ston the Depressed.
May 25 '10 #1
4 1772
ADezii
8,834 Expert 8TB
@stonward
Are there related Tables Linked to the PK, and if so, how many?
May 25 '10 #2
NeoPa
32,556 Expert Mod 16PB
Auto-incrementing.

What exactly do you mean by that? Is an AutoNumber type the sort of thing?

From what I understand of your predicament it sounds quite doable to fix this. Fixing the one changing their spec 1/2 way through is another matter of course. One I'll leave to you if I may ;)
May 25 '10 #3
stonward
145 100+
Thanks for the replies, Guys - i've been away weeping....

Yeah, there are hundreds of linked records, ADezii.
Actually, what I was after is quite simple (I think) for a good coder....automatically add '1' to last record number, like the autonumber does (most of the time)?
Additionally, I thought I'd move my 'primary' queries to SQL in the code window since they are all quite similar (my queries). I've made them public variables, but they still generate an 'Invalid Outside Procedure' error. Surely I've not got to repeat the SQL for every procedure?

Thanks for your help.

Ston the Shameless... ;)
Jun 2 '10 #4
NeoPa
32,556 Expert Mod 16PB
To implement an AutoNumber-like field in your form you can use DMax() with appropriate criteria to set the field at the point of adding the record.

NB. That last bit was important. The reason the AutoNumber value is not shown until the record has already been created is because the sequence would not work very well if values were assigned at any point prior to usage being guaranteed (In other words, if it's still possible for the save to be stopped then the value should not yet have been assigned).
Jun 2 '10 #5

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

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
10
by: Ivan Voras | last post by:
Are there any performance/size differences between using tuples and using lists? -- -- Every sufficiently advanced magic is indistinguishable from technology - Arthur C Anticlarke
32
by: Dave Benjamin | last post by:
Hey all, I just realized you can very easily implement a sequence grouping function using Python 2.3's fancy slicing support: def group(values, size): return map(None, * for i in...
23
by: Fuzzyman | last post by:
Pythons internal 'pointers' system is certainly causing me a few headaches..... When I want to copy the contents of a variable I find it impossible to know whether I've copied the contents *or*...
9
by: Nico Grubert | last post by:
Hi there, Background of this question is: I want to convert all words <word> except 'and' / 'or' / 'and not' from a string into '*<word>*'. Example: I have the following string: "test and...
4
by: J. Campbell | last post by:
I'm a novice with c/c++ and have been reading Eckel's book. I'd like some feedback on using this method. What I need to do is treat a string as numeric data. I know how to write functions to...
3
by: HABJAN ®iga | last post by:
Is there a way to enumerate all controls in a form (for each c in form) - (even nested ones: in panels,...)? best re, habix
13
by: HABJAN ®iga | last post by:
I'am using form's keypreview property & keydown (on form) to look for hotkeys (alt+?) Everything works fine, except when i have focus on combobox. Then the event on form isn't raised. Can...
5
by: elyob | last post by:
Hi, a quick hello first to all on this group! I've been looking at getting into c# for a while now, and think I have just about all the tools, and a fair amount of literature on the subject....
13
by: DorkyGrin | last post by:
Hi, Couple of questions: 1. I need to rename a PDF based on some information inside a text file. Someone gave me some vbs code (see below) that I'd like to convert into VB.net. I want GUI and...
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
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
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
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.