Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Control Reference

Status
Not open for further replies.

mtompkins

IS-IT--Management
Jan 14, 2003
166
US
Sorry all - I just can't remember

I am trying to have the content on tabs start with their visibile setting to false but I can't remember the coding.

I'm trying

Forms!frmMenu.TabCtl0.Pages(2)!Label49.Visible = False

however this fails.

Would someone please kick start my memory.

Thanks
 
Fancy -

Thank you for the effort but that certainly won't work.
This is being executed during a main form OnLoad event and needs to reference the particular element.
 
during a main form OnLoad event
You want to play with controls when the form isn't fully loaded ?
 
It really isn't worth getting into the process... I'll I'm looking for is the syntax to reference a control element (such as a label) with the full reference.

Forms!formname.... etc.
 
As indicated by FancyPrairie, controls residing on a tab control, can be referenced as if they where put directly on the form itself. No need to do any tab control referencing at all. Valid references are for instance

[tt]Label49.Visible = False
me!Label49.Visible = False
forms!frmNameOfForm!Label49.Visible = False[/tt]

which is the full reference to the control, or - in a module, just use the following notation:

[tt]strFormName = "frmFormName"
forms(strFormName)("Label49").Visible = False[/tt]

If you really want to bother with it, you could try something like this:

[tt]Forms!frmMenu.TabCtl0.Pages(2).controls!Label49.Visible = False[/tt]

But you haven't given us enough information to figure out what it is you really want... so then you're left with guessing...

Another way of addressing only the controls on a tab control, and then also a bit more dynamicly, is

[tt]dim ctl as control
for each ctl in me!TabCtl0.Pages(2).controls
select case ctl.controltype
case actextbox, accombobox
ctl.visible = false
end select
next ctl[/tt]

More looping hints can probably be found in faq702-5010

Roy-Vidar
 
Hi Roy -

And yes I understand I didn't supply the why...it is really because the statement comes from a .NET piece - and not worth breaking down.

In any event

Forms!frmMenu.TabCtl0.Pages(2).controls!Label49.Visible = False

was what I needed...thanks much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top