master form sending sub-form messages??

D

dan

I have a master form and a sub-form. The sub-form
contains a tabbed menu. Depending on certain values in
the master form's current record, I want to hide certain
tabs in the sub-form.

I was thinking that, when the master form receives an
OnCurrent event, I can signal to the sub-form to alter its
tabs. However, I want to know what the best method of
doing this is. I don't want to use the Forms![sub-form]
notation as I may have two instances of the same form open.

Any ideas would be greatly welcomed.

Regards,

Dan.
 
S

Sandra Daigle

Hi Dan,

I'm confused by this:
I don't want to use the Forms![sub-form]
notation as I may have two instances of the same form open.

If you are truly talking about a subform (a child form within a main form),
the reference is:

forms!frmMain.sfrmSubFormCtl.form.tabMyTab

If you have multiple instances of the subform on the mainform, each has a
unique subform control name, and you would just plug the correct names in to
the above in place of 'sfrmSubFormCtl'.

If you are talking about multiple instances of the main form (frmMain), then
you must already have an object variable that points to each instance. The
way you'd reference the subforms in this situation depends on how you're
storing the form variables.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

I have a master form and a sub-form. The sub-form
contains a tabbed menu. Depending on certain values in
the master form's current record, I want to hide certain
tabs in the sub-form.

I was thinking that, when the master form receives an
OnCurrent event, I can signal to the sub-form to alter its
tabs. However, I want to know what the best method of
doing this is. I don't want to use the Forms![sub-form]
notation as I may have two instances of the same form open.

Any ideas would be greatly welcomed.

Regards,

Dan.
 

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