Tab control page reference to form

G

Guest

Hi,

I have a tab control with several pages. On each page is a form, and I want
to reference the visible property of these forms (Rather than individual
controls within the form).

tabMainTree.Pages.Item(tabMainTree.Value).Controls gets me to the controls
on the page, but can I specifically reference the form object, or do I still
have to iterate through each control looking for an acForm?

Thanks in advance.

swas
 
G

Guest

You sdhouldn't need to go though the tab control/page to get a reference to
the subform. You should be able to directly set the visible property like
this:

Me.SubForm1.Visible = False

being sure to reference the subform control rather than its source form.

Barry
 
G

Guest

Barry,

Thanks for the reply.

Yes I understand I can reference the form directly, but I want to be able to
make reference to the generic form for the page, not a specific form for a
specific page. This is because I may need to alter the property on several
different tabs.

I could search through controls looking for one with an 'hasmodule'
property, or reference the form directly as you say (Just doing it for a few
pages). It was just one of those things you think you can do in one line of
code, and it gets the better of you...

Normally it is the other way around - you write 50 lines of code only to
find a property / method that achieves the task in one line.

Thanks again.


swas
 

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