473,586 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

subform data from 2 other forms

I have a main form which contains information for several subforms
which I can link no problem but i also have some other information
from another table which i wish to attach to the main form for the
subsequent forms to read.

i am unable to use this table in a subform as i am not able to carry
the other info over.

eg. mainform = student details(id,name ,class)
subform = subject(id,subj ect)

subform2 = teachers report(id, student.id,
student.name,su bject,report)

i can link subform2 to mainform and copy over the relevent pieces but
can not connect subform1. if i put subform2 inside subform1 i am
unable to read the info from mainform.
Nov 12 '05 #1
1 1666
What is the common field between the RecordSource of the main Form and the
RecordSource of the Form embedded in Subform1?

Unfortunately, you'll need to clarify for me what you mean by
" some other information from another table which i wish to attach to the
main form for the subsequent forms to read. i am unable to use this table in
a subform as i am not able to carry the other info over." Specifically "wish
to attach", "for the subsequent forms to read", and "carry the other info
over" just puzzle me.

To refer to the main Form from a second-level Subform's Form code:

Me.Parent.Paren t!<controlnameo nmainform>

It seems to me that it would be likely that another table, a "junction"
table, would exist to define the relationship between "student" and
"subject" since each defines an entity. It wouldn't make much sense to have
several foreign keys to the "subject" table in the student table, because
that would violate good relational database design principles, nor to have
multiple copies of all the information about a subject for each student
enrolled in that subject.

If you do not, adding that table, and using it as the link between the main
form and the subform would be the appropriate thing to do -- the form in
subform1 would likely be based on a query joining the junction table with
the subject table.

Larry Linson
Microsoft Access MVP

"jbroome" <jb*****@ntlwor ld.com> wrote in message
news:c9******** *************** **@posting.goog le.com...
I have a main form which contains information for several subforms
which I can link no problem but i also have some other information
from another table which i wish to attach to the main form for the
subsequent forms to read.

i am unable to use this table in a subform as i am not able to carry
the other info over.

eg. mainform = student details(id,name ,class)
subform = subject(id,subj ect)

subform2 = teachers report(id, student.id,
student.name,su bject,report)

i can link subform2 to mainform and copy over the relevent pieces but
can not connect subform1. if i put subform2 inside subform1 i am
unable to read the info from mainform.

Nov 12 '05 #2

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

Similar topics

6
2028
by: Ray | last post by:
I have a main form with a subform. The main form has a combo box which lists all the clients which in turn are displayed in the subform. The subform is bound to the combo box and all work well. however, I would like to be able to add a new client in the subform but this is, of course bound to the combo box. Can anyone tell me if there is a...
2
376
by: Salad | last post by:
I have a sub routine that I'd like to use to get data from a main form or from a subform preferably using 1 variable. Ex: If Me.OpenArgs = "SF" Then strForm = "MF!SF" Else strForm = "MF" Endif Me.Text1 = Forms(strForm)!Text1
25
10194
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...
12
18999
by: MLH | last post by:
I have created two forms: frmBrowseNegsMainform and frmBrowseNegsSubform. I put a subform control on the first of these. The SourceObject property for the subform control is, of course, frmBrowseNegsSubform. I would like to perform an ascending or descending sort on any of the 7 columns shown in datasheet view in the subform control. I've...
4
6990
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which...
3
1923
by: panwala_bhavesh | last post by:
I have a subform in continuous form style that I use to populate 3 fields (textboxes) on my main form with a double-click of the key-field textbox of the sub: Private Sub TextBattID_DblClick(Cancel As Integer) Forms!. = Me! Forms!. = Me! Forms!. = Me! End Sub
9
9676
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
4
8822
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form which allows me to edit the record in the subform. What I want to happen is for subform with the new edits to be updated on the main form when I...
1
5417
by: Stinky Pete | last post by:
Hi everyone, I have been updating a file that uses a main form that contains a subform (as a datasheet). The main form really does not do anything on opening except maximizes to the users screen size. The subform however runs an "embedded" query (cause I don't know the right term) to show a list of records based on the embedded query. ...
3
9232
by: Richnep | last post by:
Hi all, I have tabbed subforms where I need to copy one field value from one subform over to another subform. Although I can run an update query to accomplish this I would like to do it through VBA. sub tables relationships are 1:N with the main table. So the recods display like this in the subform:
0
8202
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. ...
1
7959
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...
0
8216
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...
0
6614
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...
0
5390
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
3837
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
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1180
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.