473,614 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subform Wizard and number of primary key fields

I have two tables in a 1:M relationship- the parent has 5 fields in the
primary key and the child 6 (these are actually pretty far downstream in
a complicated ER model, but the problem is between these two). I set up
the relationship with no problem- referential integrity and left outer
join. I have created two forms- one for the parent and one for the
child table. I want to import the child table's form as a subform on
the parent table's form. Using the Subform Wizard, everything goes well
until it gets to the point where I need to specify the linking fields.
It shows a number of entries for these, all of which are single, key fields.

My problem is that Access allows only up to 3 fields for linking a
subform to a parent form, and that would force my having to enter
manually the other 2 fields in the primary key from the parent into the
child. Is there any way of getting around this? Thanks!
Feb 19 '06 #1
2 2239
"John" <jh********@yah oo.com> wrote in message
news:dt******** ***@netnews.upe nn.edu...
I have two tables in a 1:M relationship- the parent has 5 fields in the
primary key and the child 6 (these are actually pretty far downstream in a
complicated ER model, but the problem is between these two). I set up the
relationship with no problem- referential integrity and left outer join. I
have created two forms- one for the parent and one for the child table. I
want to import the child table's form as a subform on the parent table's
form. Using the Subform Wizard, everything goes well until it gets to the
point where I need to specify the linking fields. It shows a number of
entries for these, all of which are single, key fields.

My problem is that Access allows only up to 3 fields for linking a subform
to a parent form, and that would force my having to enter manually the
other 2 fields in the primary key from the parent into the child. Is
there any way of getting around this? Thanks!

When you say 'enter manually' you do realise that you could use vba code to
do this. In other words, you do not use the subform wizard so that the
child/master fields are not filled in at design time. You then write code
in the form's current event which tells the subform which records to
display. Code will need to be written for when you add a new record,
automatically inserting the required values.

Having said all this, I would change the table design to use single keys -
that is autonumber/long integer fields. You do realise that you can set up
a unique index over these 6 fields without it needing to be primary. I
understand there may be arguments in favour of your approach, but in my
experience the single-key approach is preferable.
Feb 19 '06 #2
Anthony England wrote:
"John" <jh********@yah oo.com> wrote in message
news:dt******** ***@netnews.upe nn.edu...
I have two tables in a 1:M relationship- the parent has 5 fields in the
primary key and the child 6 (these are actually pretty far downstream in a
complicated ER model, but the problem is between these two). I set up the
relationship with no problem- referential integrity and left outer join. I
have created two forms- one for the parent and one for the child table. I
want to import the child table's form as a subform on the parent table's
form. Using the Subform Wizard, everything goes well until it gets to the
point where I need to specify the linking fields. It shows a number of
entries for these, all of which are single, key fields.

My problem is that Access allows only up to 3 fields for linking a subform
to a parent form, and that would force my having to enter manually the
other 2 fields in the primary key from the parent into the child. Is
there any way of getting around this? Thanks!

When you say 'enter manually' you do realise that you could use vba code to
do this. In other words, you do not use the subform wizard so that the
child/master fields are not filled in at design time. You then write code
in the form's current event which tells the subform which records to
display. Code will need to be written for when you add a new record,
automatically inserting the required values.

Having said all this, I would change the table design to use single keys -
that is autonumber/long integer fields. You do realise that you can set up
a unique index over these 6 fields without it needing to be primary. I
understand there may be arguments in favour of your approach, but in my
experience the single-key approach is preferable.

Thanks! I do know about the VBA thing, but this is for a group of
people I'm teaching who don't know VBA at all. As to the autonumber,
that won't work, I'm afraid- the applications these people will be
creating (for medical research) don't do well at all with the autonumber
approach. Thanks anyway!

Feb 19 '06 #3

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

Similar topics

12
3491
by: turtle | last post by:
I am creating a database that tracks the Techinical Skills of our engineers. There are about about 200 techinical skills that they will need to fill out by giving themselves a ranking. Some fields they will not fill out and others they will. Here is an example: Employee # 1 Languages Skill Experience (yrs) C++ 3 4 VB 2 2
3
3961
by: Uwe Range | last post by:
Hi to all, I am displaying a list of records in a subform which is embedded in a popup main form (in order to ensure that users close the form when leaving it). It seems to be impossible to delete a record in this subform. When I switched modal off and tried to delete a record from the list, I deleted a record on another form (below the popup form).
25
10211
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
0
2013
by: Jason | last post by:
I have a primary form which is used to enter/edit data in a table named Test_Results. On this primary form there is a subform which displays site addresses. This subform is linked to the primary form by field named TestID. The subform is used just for displaying site address data, data which is stored in another table named Total_Site_Address. In the Total_Site_Address table there are numerous fields that form the site addresses...
4
54881
by: Peter Bailey | last post by:
I have a subform that I dont want to have a recordsource initially as it is locking the table that is created dynamically. I want to connect to the table after the data has been written by another routine. I had hoped I could do mytable.recordsource = myquery
0
291
by: Jean | last post by:
Hello everybody. Can someone point out please what is wrong with my work? What I have so far: People take part in experiments, and a record is made in tblExperimentInstances. There are a number of different experiments, as listed in tblExperimentType. I have the following table structure: tblPeople: PeopleID ,primary key
4
2651
by: Don Do | last post by:
Help I built a form/subform/subsubform setup using the access forms wizard. I have a table1 = parent, table2 = child, table3 = (grandchild?). There will be multiple records in table2 that tie to table1, and multiple records in table 3 that tie to table2. Both on "1 to many" joins. Each of the forms are bound to the fields in the respective tables. The subform & subsubform are datasheet view. When I enter any data, I
8
23778
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Form is: Forms!FormName..RowSource = "TableOrQueryName"
7
2816
by: PotatoChip | last post by:
Ok, I have a form and a subform. The form shows a document with it's pertinent information. The subform has some of the same fields as the form and shows where the document was sent. The main form fields are: Number, Type, Title, Version, EffectiveDate, Status, Owner, Reference, ChangeRequestNo, Comments The subform fields are: DDL_ID, Type, Number, Version, DocCtrlNo, Location, Returned, ChangeRequestNo I know it is redundant to have...
0
8197
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8640
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8589
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8287
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8443
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5548
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2573
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.