referring to subform on tab control

Yuri

New member
Local time
Today, 17:08
Joined
Jul 18, 2011
Messages
5
Hi there,
After my quick solution of my problem yesterday I thought why not ask for some help on another issue I have.

I have an unbound form (say level A). On this unbound form I have placed a tabbed control with two pages (say level B). On page 1 I have put one subform (say level C with sfrm_levelC1) on which I have put two subforms, each of which is connected to a bound form (say level D: sfrm_levelD1 and sfrm_levelD2). Now on page 2 I also put one subform (so also level C with sfrm_levelC2) from which I would like to create a refreshment of one of the subforms of level D on page 1 (say sfrm_levelD1), if you click a selection button on sfrm_levelC2.

I tried lots of combinations but the one most logical to me:

Me!sfrm_levelC1.Form!sfrm_levelD1.Form.Recalc

gives me a run-time error 2465 startup can't find the field "sfrm_levelC" referred to in your expression.

Could anyone help me with this puzzle? Thanks in advance !!
 
Thanks Gina !!

but I still can't figure it out. Actually I used the website you referred to, to set up the code. I thought I was on sub 1 referring to a control property, like enabled on sub 2, so code: Me!Subform2.Form!ControlName.Enabled on this webpage.

And then I need to refer to the subform on Subform2 in this code (say Subform2a). Therefore I put: Me!Subform2.Form!Subform2a.Recalc .
But of course I tried lots of other combinations. But probably the problem is that I need to refer to a subform on a subform.

Yuri
 
Okay, I have a tried and true way of figuring out how to refer to a control when nothing else works...

1. Open form in Design View
2. Put a Text Box on the form you want to put the function on
3. In the Properties Window for the Text Box go to the Control Source and click the Elipse button [...]
4. In the window that opens navigate to the form you want to refer to
5. Once there in the center window double click on <Form> and the path will show in the window above
6. Copy what you see in the above window and cancel out till back at the Properties Window.
7. Now, go paste that path in your function...

That should get you the correct path.
 
Many many thanks Gina !!
Excellent way to solve your form reference problems. Great forum here !!
Yuri
 
I'm going to assume your issue is resolved...:D

You're most welcome!
 

Users who are viewing this thread

Back
Top Bottom