473,507 Members | 6,727 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 1767
"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 misunderstanding 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*********************@news.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
14914
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....
2
4004
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...
5
6103
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
1521
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...
3
1356
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...
6
1639
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,...
3
58983
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: ...
0
2051
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
2217
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...
0
7109
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
7313
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
7372
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
7029
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
7481
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
4702
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...
0
3190
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
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
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...

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.