Help referencing controls on subforms

bigalpha

Registered User.
Local time
Yesterday, 18:19
Joined
Jun 22, 2012
Messages
415
For the life of me, I cannot figure this out. In the attached picture has a representation of my setup.

My main form has a listbox search form (taken from this site). The search results populate data in subform1.

In the detail section of main form has subform1 with 3 cascading combo boxes. I have queries set up that run the cascading combo boxes.

In the detail of subform1, I have subform2 with a combo box.

Today I decided to merge my search form and the other forms so I wouldn't have two pages. Everything used to work with no errors - but I can't figure out how to reference everything properly now.

I've tried every combination from here to reference things properly. Somehow, I'm missing something. Any help is greatly appreciated.
 

Attachments

  • Subform Layout.jpg
    Subform Layout.jpg
    79.8 KB · Views: 146

Thanks! I watched the videos but still am missing something.

If I am scrolling through my search list box in Main Form, I don't get an error when I use:
Code:
[forms]![MainForm].[form]![Subform1].[form]![cbocat1]
but I do if I use:
Code:
[Me]![Subform1].[form]![cbocat1]
Why is that?

I can't get any syntax to recognize combo3 on subform2.
 
Can you post a copy of the database? Remove anything personal/confidential first.

You could try (guessing)

Me.Subform1.Form!Subform2.Form.cbo3
 
Last edited:
Can you post a copy of the database? Remove anything personal/confidential first.

You could try (guessing)

Me.Subform1.Form!Subform2.Form.cbo3

Ok, I uploaded a sanitized version in 2003 and 2007 formats.

On the open Navigation screen > Waste Search Form > click on the only record and the data populates the bottom half of the screen.

I figured out the problem I was having with CAT 1, CAT 2 AND CAT 3 combo boxes.

The field in question right now is 'CLIN Suffix'. If you click the combo box, it asks you for a parameter value.
 

Attachments

Look at the RowSource of the combo.
 
I looked at the 2003 and have no idea WHAT I'm looking for.

I figured out the problem I was having with CAT 1, CAT 2 AND CAT 3 combo boxes.
What exactly did you figure out?
 
I looked at the 2003 and have no idea WHAT I'm looking for.


What exactly did you figure out?

I had to incorporate a .requery even for the fields CAT 1, CAT 2 CAT 3 so they'd update after I selected a new record in the search list box. So that fixed that problem.

The other problem I can't figure out is in the field "CLIN Suffix" on the bottom right. It is cascaded off of 'CLIN Num' (the field next to it). Some reason I cannot get the control reference in the row source of 'CLIN Suffix' to be correct.
 
So I figured this out.

The name of my subsubform is 'frmInputEtid'. When I generate the syntax with that, I get an error that it cannot be found.

however, when I generate the syntax using the event builder, it changes the name to 'subfrmInputEtid'. What's up with that?

Edit: Used the event builder to generate the paths of the controls I needed to reference. Got the rest of it worked out. Thanks for the help.
 
Last edited:
Glad you have it working.
 
Any idea why Access would still use an old form name for the reference instead of the new one?
Because in the "Main" form where you have placed it, the name of it is "subfrmInputEtid", but the source object is "frmInputEtid".
 
Because in the "Main" form where you have placed it, the name of it is "subfrmInputEtid", but the source object is "frmInputEtid".

:banghead: I somehow missed that. Ugh.
 

Users who are viewing this thread

Back
Top Bottom