SUB-SUB-Form Reference

Cosmos75

Registered User.
Local time
Yesterday, 21:15
Joined
Apr 22, 2002
Messages
1,280
OK, How do I reference the Sub-Subform from a Subform?

I have MAIN Form that has a SUB-Form.

The SUB-Form has a Sub from of it's own (SUB-SUB-form]

Here's how to reference a sub-form ComboBox from a main form (From Pat Hartman):
[Forms]![MainFormName]![SubFormName].Form![ComboboxName].Requery

Here's my question...

How do I reference the SUB-SUB-form from the SUB-Form??

Here's what I have in the MAIN-Form ComboBox:
[Form]![SUB-Form]!cboSUBSelect.Requery
[Form]![SUB-Form]!cboSUBSelect.SetFocus

Didn't put the MAIN-Form name since this way worked.

I have tried a vareity of ways for the SUB-Form ComboBox to synchronize the SUB-SUB-Form and nothing I tried worked.

Thanks in advance!!!

p.s. Does naming my forms "frm_(Sub Category) Work" cause any problems?

[This message has been edited by Cosmos75 (edited 06-04-2002).]

[This message has been edited by Cosmos75 (edited 06-05-2002).]
 
Forms![Form1]![Form2].Form![Form3].Form![FName]

References the FName field on Form3 which is a sub form on Form2 which is a sub form on Form1.

Replace the form names and the field name and it should work for you.
 
scottfarcus,

Here's what I put in

'Forms![Form1]![Form2].Form![Form3].Form![FName]
Forms![frm_(Sub Task) Projects]![frm_(Sub Task) Facility].Form![frm_(Sub Task) Tasks].Form![cboFacilityTaskSelect].Requery
Forms![frm_(Sub Task) Projects]![frm_(Sub Task) Facility].Form![frm_(Sub Task) Tasks].Form![cboFacilityTaskSelect].SetFocus

But I get this message:

Run-Time Error '2465':
Microsoft Access can't find the field 'frm_(Sub Task) Tasks' referred to in your expresson??

If it helps, I am trying to reference the FORM3 from a combobox in FORM2.


[This message has been edited by Cosmos75 (edited 06-05-2002).]
 
Open Form1 (the highest level form).

Go to the database window.

Go to design view of any query (or make a new one).

Click in any column of the query grid.

Click the BUILD button on the toolbar. The one with the wand on it.

In the left-hand panel, expand forms.

Expand Loaded Forms.

Expand Form1.

Expand Form 2.

Click on Form 3.

In the middle pane, double-click on the control you would like to requery.

Highlight all the text displayed in the top panel. Copy the text.

Go to your code and paste this text and then add ".Requery".

If this doesn't work, you need to clean up your form names. Access may not like the parentheses and spaces in your form names.

Check out this site...
http://www.mvps.org/access/general/gen0012.htm

Good luck!
 
scottfarcus,

THANK YOU! THANK YOU! THANK YOU!!!

I will try that it! It may just be time to revamp my database.
 
scottfarcus,

Yeah, I think I gotta change my naming convention. Did as you instructed, it now doesn't give me the Run Time error message but now after I choosen a value from ComboBox in Form2, it still asked me for the value. Will check my query to make sure it's correctly done to be sure. But I think I'm still gonna go ahead and change my naming convention.

THANK YOU FOR ALL YOU HELP!
 

Users who are viewing this thread

Back
Top Bottom