Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Visability

Geek News

Visability
Tom 12/12/2008 4:06:11 PM
I have my form with a multitude of tabbed sub forms at the bottom. I would
like to only have one tab visible, based on the data from one field on the
"Main" part of the form...

How can I do this??

Thanx
Tom
Re: Visability
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 12/12/2008 4:31:12 PM
Tom wrote:
[Quoted Text]
> I have my form with a multitude of tabbed sub forms at the bottom. I
> would like to only have one tab visible, based on the data from one
> field on the "Main" part of the form...
>
> How can I do this??
>
> Thanx
> Tom
If only one subform is going to be visible at a time you could probably
eliminate the tab control.In the Change Event of The TabControl

Private Sub MyTab_Change()
MyTab.Pages(2).Visible = MyTab.Page<>0
End Sub

From a Pieter Wijnen and posted at eggheadcafe.comYou will also have to set
the focus to that tab.


Re: Visability
Tom 12/12/2008 4:43:01 PM
Not quite sure. How do I "Link" this to the field in question??

"Mike Painter" wrote:

[Quoted Text]
> Tom wrote:
> > I have my form with a multitude of tabbed sub forms at the bottom. I
> > would like to only have one tab visible, based on the data from one
> > field on the "Main" part of the form...
> >
> > How can I do this??
> >
> > Thanx
> > Tom
> If only one subform is going to be visible at a time you could probably
> eliminate the tab control.In the Change Event of The TabControl
>
> Private Sub MyTab_Change()
> MyTab.Pages(2).Visible = MyTab.Page<>0
> End Sub
>
> From a Pieter Wijnen and posted at eggheadcafe.comYou will also have to set
> the focus to that tab.
>
>
>
Re: Visability
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 12/12/2008 8:40:22 PM
If My!field = some condition then
MyTab.Pages(2).Visible = true
else
MyTab.Pages(2).Visible = fales
end if
Tom wrote:
[Quoted Text]
> Not quite sure. How do I "Link" this to the field in question??
>
> "Mike Painter" wrote:
>
>> Tom wrote:
>>> I have my form with a multitude of tabbed sub forms at the bottom.
>>> I would like to only have one tab visible, based on the data from
>>> one field on the "Main" part of the form...
>>>
>>> How can I do this??
>>>
>>> Thanx
>>> Tom
>> If only one subform is going to be visible at a time you could
>> probably eliminate the tab control.In the Change Event of The
>> TabControl
>>
>> Private Sub MyTab_Change()
>> MyTab.Pages(2).Visible = MyTab.Page<>0
>> End Sub
>>
>> From a Pieter Wijnen and posted at eggheadcafe.comYou will also have
>> to set the focus to that tab.


Re: Visability
Tom 12/12/2008 9:15:01 PM
Maybe getting closer. It isn't working quite right. The tab I try it on is
still visible no matter what the Department field is showing. Also, may not
be puttin g it in the right spot. Don't see a "Change" event on the tab
control.

Working with Acces 2007 and still not comfortable finding my way around.

"Mike Painter" wrote:

[Quoted Text]
> If My!field = some condition then
> MyTab.Pages(2).Visible = true
> else
> MyTab.Pages(2).Visible = fales
> end if
> Tom wrote:
> > Not quite sure. How do I "Link" this to the field in question??
> >
> > "Mike Painter" wrote:
> >
> >> Tom wrote:
> >>> I have my form with a multitude of tabbed sub forms at the bottom.
> >>> I would like to only have one tab visible, based on the data from
> >>> one field on the "Main" part of the form...
> >>>
> >>> How can I do this??
> >>>
> >>> Thanx
> >>> Tom
> >> If only one subform is going to be visible at a time you could
> >> probably eliminate the tab control.In the Change Event of The
> >> TabControl
> >>
> >> Private Sub MyTab_Change()
> >> MyTab.Pages(2).Visible = MyTab.Page<>0
> >> End Sub
> >>
> >> From a Pieter Wijnen and posted at eggheadcafe.comYou will also have
> >> to set the focus to that tab.
>
>
>
Re: Visability
Ron2006 <ronnemec[ at ]hotmail.com> 12/12/2008 9:49:00 PM
It seems to me that you would want to stick that code in the OnCurrent
event of the form itself and in the afterupdate event of the field
that is being used to control which tabs are to be visible.


Ron
Re: Visability
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 12/13/2008 8:29:06 PM
The code goes in an event for the field that is changing, not on the tab.
The field changes the tab.

In general events "send" information. If they received they would all have
to be firing all the time.

Note also that you may have to make the other tabs invisible and bring the
one you want to the top.


Tom wrote:
[Quoted Text]
> Maybe getting closer. It isn't working quite right. The tab I try
> it on is still visible no matter what the Department field is
> showing. Also, may not be puttin g it in the right spot. Don't see
> a "Change" event on the tab control.
>
> Working with Acces 2007 and still not comfortable finding my way
> around.
>
> "Mike Painter" wrote:
>
>> If My!field = some condition then
>> MyTab.Pages(2).Visible = true
>> else
>> MyTab.Pages(2).Visible = fales
>> end if
>> Tom wrote:
>>> Not quite sure. How do I "Link" this to the field in question??
>>>
>>> "Mike Painter" wrote:
>>>
>>>> Tom wrote:
>>>>> I have my form with a multitude of tabbed sub forms at the bottom.
>>>>> I would like to only have one tab visible, based on the data from
>>>>> one field on the "Main" part of the form...
>>>>>
>>>>> How can I do this??
>>>>>
>>>>> Thanx
>>>>> Tom
>>>> If only one subform is going to be visible at a time you could
>>>> probably eliminate the tab control.In the Change Event of The
>>>> TabControl
>>>>
>>>> Private Sub MyTab_Change()
>>>> MyTab.Pages(2).Visible = MyTab.Page<>0
>>>> End Sub
>>>>
>>>> From a Pieter Wijnen and posted at eggheadcafe.comYou will also
>>>> have to set the focus to that tab.


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net