navigating

J

judith

I have real problems with stepping around forms.

From
mainFrom - Tabctl1(page1) - subForm1 - Tabctl2(page1) - subform21
how do I co to control on
mainFrom - Tabctl1(page1) - subForm1 - Tabctl2(page2) - subform22

I am trying to use
Set ctl = xxxxxxxxx
DoCmd.GoToControl ctl.Name

Any help would be much appreciated
thanks
 
D

Douglas J Steele

What are you putting for xxxxxxx?

The fact that you have tab controls is irrelevant: control names on tab
controls must be unique on their own.

What's important to recognize is the difference between the name of the
subform container on a form and the name of the form being used as a
subform. They may not be the same. If you create the subform by dragging
FormA onto FormB, the subform container will usually be named FormA
(although if you already have a subform container named FormA, it will be
named something else). If you create the subform by drawing a subform
container from the tool box onto your form, then filling in the details
(either manually or using the wizard), the subform container will usually be
named something like Child0 (where 0 could be any number). When referring to
controls on subforms, you need to refer to the parent form's subform
container, and then look at the Form property of that control:

That means if you're trying to refer to a control MyControl on your subform,
you'd use:

Me!MySubformContainer.Form!MyControl

If you want to refer to a control on a subform on that subform, you'd use
something like:

Me!MySubformContainer.Form!MyOtherSubformContainer.Form!MyOtherControl

See whether http://www.mvps.org/access/forms/frm0031.htm at "The Access Web"
helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top