473,569 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Record Numbering problem...

I know this should be easy (I think), but I can not figure out how to do
it.

Basically, I have 4 tables (2 tables with 2 subordinate tables) that
have an INQ_ID key that was created by using "Auto-increment".

(What I mean by 4 tables is that I have 2 "Main" tables with a
subordinate table tied to each of them.)

Now, I have to merge these tables so that I only have 2 tables (the data
is the same, the tables were created at different times, so, the
"Auto-increment" for the INQ_ID is overlapping).

This is basically my problem, I have about 20,000 records that the
INQ_ID overlaps. I need to figure out a way to change ONE of the tables
(and its subordinate table) so that the INQ_IDs are in a different range
of numbers so that when I merge the 4 tables (2 main, 2 subordinate),
the INQ_ID will not overlap.

I know I am not explaining it very well, but if there is any
clarification needed, just post the clarification question, and I will
follow it up ASAP because I really need to fix this (redundant to have 2
separate tables with the same fields in the database).

Thanks for any help,
Reaper

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
5 1772
"Grim Reaper" <re****@nospam. com> wrote in message
news:3f******** *************** @news.frii.net. ..
I know this should be easy (I think), but I can not figure out how to do
it.

Basically, I have 4 tables (2 tables with 2 subordinate tables) that
have an INQ_ID key that was created by using "Auto-increment".

(What I mean by 4 tables is that I have 2 "Main" tables with a
subordinate table tied to each of them.)

Now, I have to merge these tables so that I only have 2 tables (the data
is the same, the tables were created at different times, so, the
"Auto-increment" for the INQ_ID is overlapping).

This is basically my problem, I have about 20,000 records that the
INQ_ID overlaps. I need to figure out a way to change ONE of the tables
(and its subordinate table) so that the INQ_IDs are in a different range
of numbers so that when I merge the 4 tables (2 main, 2 subordinate),
the INQ_ID will not overlap.

I know I am not explaining it very well, but if there is any
clarification needed, just post the clarification question, and I will
follow it up ASAP because I really need to fix this (redundant to have 2
separate tables with the same fields in the database).


If you have cascade update turned on you should be able to change the AutoNumber
on one main table to a standard Long Integer. Then run an update query that
adds a fixed amount to all of those values so that the smallest value will now
be a bit larger than the largest AutoNumber value in the other main table. The
cascade update feature should make corresponding changes to the child table
values. Then you should be able to use append queries to add the revised
records into the unrevised tables.

Please try all of the above on a *copy* of your database.

--
*************** *************** *
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
*************** *************** *
Nov 12 '05 #2
bag
I may be misunderstandin g your requirements here but...

you could create a new field on one of the tables which identifies
both unique identifers from each table by creating a new identifier
that is a concatenation of the two seperate primary fields.

record number Table one primary key + Table two primary key
New field
1 123 456
123456
2 341 445
341445
Howver when handling this field in queries or whatever you would have
to reference the relevent charaters via substrings, etc.

Apologies if this is not what you want.

Bag.
Nov 12 '05 #3
My 2 cents: I have always found it inconvenient to use autonumber for the
key on a table. I think is much better to define a primary key that is
related to the meaning of the data record. It simplifies the user specifying
what record is desired.
Hugh

"Grim Reaper" <re****@nospam. com> wrote in message
news:3f******** *************** @news.frii.net. ..
I know this should be easy (I think), but I can not figure out how to do
it.

Basically, I have 4 tables (2 tables with 2 subordinate tables) that
have an INQ_ID key that was created by using "Auto-increment".

(What I mean by 4 tables is that I have 2 "Main" tables with a
subordinate table tied to each of them.)

Now, I have to merge these tables so that I only have 2 tables (the data
is the same, the tables were created at different times, so, the
"Auto-increment" for the INQ_ID is overlapping).

This is basically my problem, I have about 20,000 records that the
INQ_ID overlaps. I need to figure out a way to change ONE of the tables
(and its subordinate table) so that the INQ_IDs are in a different range
of numbers so that when I merge the 4 tables (2 main, 2 subordinate),
the INQ_ID will not overlap.

I know I am not explaining it very well, but if there is any
clarification needed, just post the clarification question, and I will
follow it up ASAP because I really need to fix this (redundant to have 2
separate tables with the same fields in the database).

Thanks for any help,
Reaper

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

Nov 12 '05 #4
I tried to use the "cascade" option (this would have made it easier, so
that I could change the INQ_ID field in one table, and the child would
also change).

One problem, there is not necessarily data for each record. In other
words, parent table might have data, but the child might not. When I
tried to use the cascade update ("enforce referential integrity"), it
said that this was not possible because there has to be a record in the
child table with data in it corresponding to my INQ_ID field (primary
key for both tables).

Is there a way that I can "get around" this so that I can update both
tables at the same time? How? (the INQ_ID was an Auto-numbered field and
each table has the same corresponding Auto_number, except, in the child
table - there was not data for the child table).

Thanks, again,
Reaper

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5
"Grim Reaper" <re****@nospam. com> wrote in message
news:3f******** *************@n ews.frii.net...
I tried to use the "cascade" option (this would have made it easier, so
that I could change the INQ_ID field in one table, and the child would
also change).

One problem, there is not necessarily data for each record. In other
words, parent table might have data, but the child might not. When I
tried to use the cascade update ("enforce referential integrity"), it
said that this was not possible because there has to be a record in the
child table with data in it corresponding to my INQ_ID field (primary
key for both tables).


Enforcing Referential Integrity with Cascade update or delete should require
that a record exist in the *parent* table. There should be no requirement that
every parent record have matches in the child table. Are you sure the error
wasn't that you have some records in the child table without matches in the
parent?
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #6

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

Similar topics

5
14922
by: Derek Cooper | last post by:
I hope you can help me. I posted this in the microsoft sql server newsgroup a few days ago and got no response so I thought I'd try here. If I can provide any clarification I'll be glad to do so. I'm trying to calculate a column based on the value of the previous record. I'm not very experienced with SQL-Server. I'm using the following...
2
4011
by: Andy Glew | last post by:
I have long looked for (and occasionally posted questions to groups such as this about) a tool that can take a group of HTML pages (nowadays XHTML, or XML) and produce a nicely formatted printable documented, featuring. * pagination * section numbering * including Dewey decimal section numbering such as Section 1.2.3 for H3
5
6112
by: Dan | last post by:
How can i find out what record number in the return set I am at? Example select *,recnum() from foo I would like to see recnum() be 1 then 2,3,4,5 and so on for each record returned.
5
1524
by: Lee-Anne Waters via AccessMonster.com | last post by:
Hello, would someone please be so kind and help me with this problem. i have this query that lists a number of order numbers on different rows however according to the query criteria the same order number may appear on many rows. what i need to do is number these order numbers as follows Order Number record number 123456 ...
3
1359
by: perryche | last post by:
Experts, I need your help in this tricky delima. FormA without record number at the bottom but has a customized record numbering with the following codes for "lblNavigate" label: If Me.NewRecord Then Me!lblNavigate.Caption = "New Record" Else With Me.RecordsetClone
6
1647
by: jpatchak | last post by:
Hello All, I am trying to code a command button on a form to create a duplicate record and renumber it. The code I have in the command button currently is; DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70...
3
59044
by: vostrixos | last post by:
Hi all I need some help. I'm working on a project where i need to move on some records depending the value that the user chooses from a list box.I use the DoCmd.GoToRecord Like this: "DoCmd.GoToRecord acDataForm, "ADV_FORM", acGoTo, LIST.Value" Where LIST.Value is the primery key of a table and that's Auto Number. The problem is that...
0
2056
by: [david] | last post by:
http://pyserial.sourceforge.net/ "port numbering starts at zero, no need to know the port name in the user program" But the implementation in SerialWin32 is just (Portnum +1)
3
2226
by: Gord | last post by:
If I have a form open with a subform control on it in datasheet view that has its record source set to a query or a table, is it possible to determine which record the user has clicked into with VB? I don't mean the text box with which you can determine the field/column, but the record (row). I guess what I'm looking for would be the...
0
7926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6287
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.