Linking Subforms 2 Issues 1 Topic (1 Viewer)

workingpoor

Registered User.
Local time
Yesterday, 21:50
Joined
Jul 19, 2006
Messages
21
I have found a lot of answers here to my multitude of questions. However, I am having two final issues. Both happen to be in my subforms.

Issue 1
I have a subform called Student addClass Subform and in the ON CLICK event of the save buttom it runs the following code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
[Forms]![Student_Classes_Subform].Requery

It Should requery a subform called Student_Classes_Subform which is in a main form called Students however it constantly tells me that is can't find that subform. I had this working before and made a few changes while working on issue 2 and some how messed it up and can't figured out what I did. Please Help!!!

Issue 2
In my main form called Students I have a 2 subforms that I need to link in the ON CURRENT EVENT I want to link Student_Classes_Subform to
Student ClassNTinfo Subform. Currently there is a relationship between the fields NT_ID. I assume that I need to pass a variable out of one subform to the main form and then back into my other subform. For the life of me I can't figure out how this works since the data is coming from two different tables. All of the examples I have scene pull from one table. Any help is great!

P.S. I am attaching the database and linked tables that will help where my explanation didn't.

Cheers
-andy
 

Attachments

  • DSS Database.zip
    103.8 KB · Views: 119

ShaneMan

Registered User.
Local time
Yesterday, 18:50
Joined
May 9, 2005
Messages
1,224
workingpoor said:
I have found a lot of answers here to my multitude of questions. However, I am having two final issues. Both happen to be in my subforms.

Issue 1
I have a subform called Student addClass Subform and in the ON CLICK event of the save buttom it runs the following code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
[Forms]![Student_Classes_Subform].Requery

It Should requery a subform called Student_Classes_Subform which is in a main form called Students however it constantly tells me that is can't find that subform. I had this working before and made a few changes while working on issue 2 and some how messed it up and can't figured out what I did. Please Help!!!

Issue 2
In my main form called Students I have a 2 subforms that I need to link in the ON CURRENT EVENT I want to link Student_Classes_Subform to
Student ClassNTinfo Subform. Currently there is a relationship between the fields NT_ID. I assume that I need to pass a variable out of one subform to the main form and then back into my other subform. For the life of me I can't figure out how this works since the data is coming from two different tables. All of the examples I have scene pull from one table. Any help is great!

P.S. I am attaching the database and linked tables that will help where my explanation didn't.

Cheers
-andy

Hey working,

on your first problem try:
[Forms]![Student_Classes_Subform].Forms.Requery

on your second problems. Is 'NT_ID' on the MainForm also?
 

workingpoor

Registered User.
Local time
Yesterday, 21:50
Joined
Jul 19, 2006
Messages
21
NO NT_ID is not...

mainform feeds from a table called Students

subform1 feeds from a table called Classes (has NT_ID field in it)

subform2 feeds from table called Notetaker (NT_ID )
 

workingpoor

Registered User.
Local time
Yesterday, 21:50
Joined
Jul 19, 2006
Messages
21
I looked around at other posts and i know the syntax should be
[Forms]![MainForm]![subform].form.requery

so for my application it should be as follows
[forms]![Student]![Student_Classes_Subform].Form.requery

however i keep getting the following message

"DSS Student Database Can't find the field 'Student' referred to in your expression"
 

ShaneMan

Registered User.
Local time
Yesterday, 18:50
Joined
May 9, 2005
Messages
1,224
workingpoor said:
NO NT_ID is not...

mainform feeds from a table called Students

subform1 feeds from a table called Classes (has NT_ID field in it)

subform2 feeds from table called Notetaker (NT_ID )

Give this a try:
Create a unbound text field on your MainForm and name it NT_ID. In it's Control Source put: =[NameOfFirstSubForm].Form![NT_ID]
then in the second SubForms Master/Child Link use NT_ID for both Link Child Fields and Link Master Fields.

This should link your first and second subforms based off of NT_ID

HTH,
Shane
 

ShaneMan

Registered User.
Local time
Yesterday, 18:50
Joined
May 9, 2005
Messages
1,224
workingpoor said:
I looked around at other posts and i know the syntax should be
[Forms]![MainForm]![subform].form.requery

so for my application it should be as follows
[forms]![Student]![Student_Classes_Subform].Form.requery

however i keep getting the following message

"DSS Student Database Can't find the field 'Student' referred to in your expression"

Be sure that you have correctly spelled the Student forms name. This error message almost always comes due to name not be spelled correctly.
 

workingpoor

Registered User.
Local time
Yesterday, 21:50
Joined
Jul 19, 2006
Messages
21
I have looked at looked but can't find the error anywhere.

Do i follow the caption name in the properties or the name of the form?
 

h33

Registered User.
Local time
Today, 02:50
Joined
Aug 7, 2006
Messages
10
Thanks very much, ShaneMan. It works great.
 

workingpoor

Registered User.
Local time
Yesterday, 21:50
Joined
Jul 19, 2006
Messages
21
Shaneman:

Your solution was correct I was using the form name of the subform instead of the control name which is why it wasn't working thanks for you help
 

ShaneMan

Registered User.
Local time
Yesterday, 18:50
Joined
May 9, 2005
Messages
1,224
workingpoor said:
Shaneman:

Your solution was correct I was using the form name of the subform instead of the control name which is why it wasn't working thanks for you help


Your welcome. Glad I could help.
 

Users who are viewing this thread

Top Bottom