473,406 Members | 2,769 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.

trying to use dual relationships and getting dupes

I have a form/table with an autoid it is linked to a table/form with
and ID as a 1 to many.
Under this form/table I need another table with many records for each
on of the many in the previous table.
form1 form2 form3
table1 table2 table3

autoid -1-------------@ ID -1-----------------@- ID2

of course it won't allow this so I put in a second ID

autoid1 -1-------------@ ID1
ID2 -1-----------------@- ID3

so ID2 is not an autoid based on a record in table 2

but when a sub sub form is built using table3
when a record is created in form2 instead of id2 generating a single
new number to be used in form3 I get 4 blank records.

there is some code under form current and even when its removed I
generate 4 ID2 records that have NO ID1 values

so instead of 1--------1
2

I am getting null 1
null 2
null 3
null 4

I can't think of why I would get 4 records generated in this way since
At first I thought that the sub sub form was generating the records
but I am getting nothing in table1 or table3.
just blank records being generated by the ID2 which is an autonumber.
autonumber-----this got me thinking but what is firing it 4 times ?

I could see 1 since its linked but why 4?



Apr 10 '07 #1
1 1593
the primary key in Table1 should be linked to a corresponding *foreign key*
in Table2.
the primary key in Table2 should be linked to a corresponding *foreign key*
in Table3.

once you've set those relationships up correctly in the Relationships
window, and enforced referential integrity on each one, then you can create
a mainform/subform/subform setup that *doesn't need any code at all* to
relate child records to parent record; Access will do it automatically.

bind the mainform to Table1.
bind subform1 to Table2.
in mainform Design view, add a subform control to "hold" subform1. set the
subform control's LinkMasterFields property to the name of the primary key
in Table1; set the LinkChildFields property to the name of the corresponding
*foreign* key in Table2.
bind subform2 to Table3.
in subform1 Design view, add a subform control to "hold" subform2. set the
subform control's LinkMasterFields property to the name of the primary key
in Table2; set the LinkChildFields property to the name of the corresponding
*foreign* key in Table3.

hth
"sparks" <js******@swbell.netwrote in message
news:2p********************************@4ax.com...
I have a form/table with an autoid it is linked to a table/form with
and ID as a 1 to many.
Under this form/table I need another table with many records for each
on of the many in the previous table.
form1 form2 form3
table1 table2 table3

autoid -1-------------@ ID -1-----------------@- ID2

of course it won't allow this so I put in a second ID

autoid1 -1-------------@ ID1
ID2 -1-----------------@- ID3

so ID2 is not an autoid based on a record in table 2

but when a sub sub form is built using table3
when a record is created in form2 instead of id2 generating a single
new number to be used in form3 I get 4 blank records.

there is some code under form current and even when its removed I
generate 4 ID2 records that have NO ID1 values

so instead of 1--------1
2

I am getting null 1
null 2
null 3
null 4

I can't think of why I would get 4 records generated in this way since
At first I thought that the sub sub form was generating the records
but I am getting nothing in table1 or table3.
just blank records being generated by the ID2 which is an autonumber.
autonumber-----this got me thinking but what is firing it 4 times ?

I could see 1 since its linked but why 4?



Apr 10 '07 #2

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

Similar topics

1
by: cvchen | last post by:
Hello, I'm implementing a data dictionary (catalogging system) that can be searched in several ways. I finished the first version without using any databases, I just had pickled dictionaries to...
3
by: Richard Fritzler | last post by:
I was given the task of designing a complete web based document prep system. In simplest terms (using a msword explanation) create a database of merge fields, and a library of templates. Allow the...
5
by: Dalan | last post by:
I have been searching the archives in an effort to discover how to derive a dual use of a single combo box - so far no go. I found the piece below which pretty much represents the usage. To...
3
by: Georges Heinesch | last post by:
Hi. This issue semms trivial, but I didn't get it working so far. I have a database, which contains dupes. I'd like to create a query, which shows all dupes (not only one record, but all...
45
by: salad | last post by:
I'm curious about your opinion on setting relationships. When I designed my first app in Access I'd go to Tools/Relationships and set the relationships. Over time I'd go into the window and see...
1
by: gdarian216 | last post by:
I am tring to get rid of dupes and his code is taking the first input and repeating it. I don't know why. this is what i have so far can anyone help #include <iostream> using namespace std; ...
5
by: Shogun | last post by:
I have an mdb with a *projects* table. I also have a *timecode* table. Projects and timecodes are related by a one-to-one relationship but I do not want to simply add the timecode field to my...
3
by: Paul Sijben | last post by:
I am running a multi-threaded python application in a dual core intel running Ubuntu. I am using python 2.5.1 that I compiled myself. At random points I am getting segmentation faults (sometimes...
1
FLEB
by: FLEB | last post by:
I'm working on a PHP/MySQL site with social networking and "message blast" functionality, and I'm not sure what the best method to represent multiple levels of interpersonal relationships in the...
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
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,...
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.