dbTalk Databases Forums  

Tabbed Control Box – Hide Pages and acquire Value

comp.databases.ms-access comp.databases.ms-access


Discuss Tabbed Control Box – Hide Pages and acquire Value in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
BEETHOVEN
 
Posts: n/a

Default Tabbed Control Box – Hide Pages and acquire Value - 04-19-2011 , 01:17 PM






I am using Access 2003 and 2007.

I have a Form (F1) with a sub form (F2). The form and sub form are not
linked in any way. On the sub form (F2) I have a Tabbed Control box
(TabCtl0) with 3 pages (Page1, Page2, Page3). On Page 1 I have a text
box (Text8) with a value in it.

Form – F1
Sub Form – F2
Tabbed Control box – TabCtl0
Tab – Page1
Text box Tab – Text8
Tab – Page2
Tab – Page3

I have two basic questions.
1) When I load the main Form (F1) I want to hide all the pages in the
Tabbed Control box on the sub form (F2). But I do not want to do each
page separately. I want to hide all of them at once. How do I do this
with code?

2) Later I want to use the value listed on Page1 in text box Text8 to
use in the criteria for a query. Here is what I have but does not work
- [Forms]![F1]![F2]![TabCtl0]![Page1]![Text8]. What is the correct
syntax to get that value to use in the criteria for a query?

Thanks for any Help you can provide.
Gary

Reply With Quote
  #2  
Old   
Marshall Barton
 
Posts: n/a

Default Re: Tabbed Control Box – Hide Pages and acquire Value - 04-19-2011 , 11:22 PM






BEETHOVEN wrote:

Quote:
I am using Access 2003 and 2007.

I have a Form (F1) with a sub form (F2). The form and sub form are not
linked in any way. On the sub form (F2) I have a Tabbed Control box
(TabCtl0) with 3 pages (Page1, Page2, Page3). On Page 1 I have a text
box (Text8) with a value in it.

Form – F1
Sub Form – F2
Tabbed Control box – TabCtl0
Tab – Page1
Text box Tab – Text8
Tab – Page2
Tab – Page3

I have two basic questions.
1) When I load the main Form (F1) I want to hide all the pages in the
Tabbed Control box on the sub form (F2). But I do not want to do each
page separately. I want to hide all of them at once. How do I do this
with code?

2) Later I want to use the value listed on Page1 in text box Text8 to
use in the criteria for a query. Here is what I have but does not work
- [Forms]![F1]![F2]![TabCtl0]![Page1]![Text8]. What is the correct
syntax to get that value to use in the criteria for a query?

Once you make sure the focus is not anywhere in the tab
control, you can hide the entire tab control.
From the main form:
Me.[F2].Form.[TabCtl0].Visible = False
or from inside subform F2 (perhaps in the Load event):
Me.[TabCtl0].Visible = False

When referring to a control placed anywhere in a tab
control, the tab control is irrelevant. The query criteria
would just be:
[Forms]![F1]![F2]![Text8]
or
[Forms]![F1]![F2].Form.[Text8]

IMPORTANT: The F2 in all of the above refers to the name of
the subform CONTROL on the main form. The name of the
subform control may or may not be different from the name of
the form object displayed in the subform control.

--
Marsh

Reply With Quote
  #3  
Old   
BEETHOVEN
 
Posts: n/a

Default Re: Tabbed Control Box – Hide Pages and acquire Value - 04-20-2011 , 07:02 AM



On Apr 19, 11:22*pm, Marshall Barton <marshbar... (AT) wowway (DOT) com> wrote:
Quote:
BEETHOVEN wrote:
I am using Access 2003 and 2007.

I have a Form (F1) with a sub form (F2). The form and sub form are not
linked in any way. On the sub form (F2) I have a Tabbed Control box
(TabCtl0) with 3 pages (Page1, Page2, Page3). On Page 1 I have a text
box (Text8) with a value in it.

Form – F1
* Sub Form – F2
* * *Tabbed Control box – TabCtl0
* * * * Tab – Page1
* * * * * *Text box Tab – *Text8
* * * * Tab – Page2
* * * * Tab – Page3

I have two basic questions.
1) When I load the main Form (F1) I want to hide all the pages in the
Tabbed Control box on the sub form (F2). But I do not want to do each
page separately. I want to hide all of them at once. How do I do this
with code?

2) Later I want to use the value listed on Page1 in text box Text8 to
use in the criteria for a query. Here is what I have but does not work
- [Forms]![F1]![F2]![TabCtl0]![Page1]![Text8]. What is the correct
syntax to get that value to use in the criteria for a query?

Once you make sure the focus is not anywhere in the tab
control, you can hide the entire tab control.
From the main form:
* *Me.[F2].Form.[TabCtl0].Visible = False
or from inside subform F2 (perhaps in the Load event):
* *Me.[TabCtl0].Visible = False

When referring to a control placed anywhere in a tab
control, the tab control is irrelevant. *The query criteria
would just be:
* *[Forms]![F1]![F2]![Text8]
or
* *[Forms]![F1]![F2].Form.[Text8]

IMPORTANT: *The F2 in all of the above refers to the name of
the subform CONTROL on the main form. *The name of the
subform control may or may not be different from the name of
the form object displayed in the subform control.

--
Marsh- Hide quoted text -

- Show quoted text -
Thank you very much Marsh
To get the value the following worked - [Forms]![F1]![F2].Form.[Text8]

As far as the hiding all the tabs in the Tabbed Control box I think I
need to give a little more explanation. What I was planning to do was
to hide all of the tabs at once. Then I would make only one tab
visible based on some criteria the user inputs. Therefore at any one
time only one tab would be visible to the user based on some criteria
they selected. I know how to make the one tab visible but I do not
know how to hide all the tabs at once unless I do them individually.

Gary

Reply With Quote
  #4  
Old   
Marshall Barton
 
Posts: n/a

Default Re: Tabbed Control Box – Hide Pages and acquire Value - 04-20-2011 , 04:48 PM



BEETHOVEN wrote:

Quote:
On Apr 19, 11:22*pm, Marshall Barton <marshbar... (AT) wowway (DOT) com> wrote:
BEETHOVEN wrote:
I am using Access 2003 and 2007.

I have a Form (F1) with a sub form (F2). The form and sub form are not
linked in any way. On the sub form (F2) I have a Tabbed Control box
(TabCtl0) with 3 pages (Page1, Page2, Page3). On Page 1 I have a text
box (Text8) with a value in it.

Form – F1
* Sub Form – F2
* * *Tabbed Control box – TabCtl0
* * * * Tab – Page1
* * * * * *Text box Tab – *Text8
* * * * Tab – Page2
* * * * Tab – Page3

I have two basic questions.
1) When I load the main Form (F1) I want to hide all the pages in the
Tabbed Control box on the sub form (F2). But I do not want to do each
page separately. I want to hide all of them at once. How do I do this
with code?

2) Later I want to use the value listed on Page1 in text box Text8 to
use in the criteria for a query. Here is what I have but does not work
- [Forms]![F1]![F2]![TabCtl0]![Page1]![Text8]. What is the correct
syntax to get that value to use in the criteria for a query?

Once you make sure the focus is not anywhere in the tab
control, you can hide the entire tab control.
From the main form:
* *Me.[F2].Form.[TabCtl0].Visible = False
or from inside subform F2 (perhaps in the Load event):
* *Me.[TabCtl0].Visible = False

When referring to a control placed anywhere in a tab
control, the tab control is irrelevant. *The query criteria
would just be:
* *[Forms]![F1]![F2]![Text8]
or
* *[Forms]![F1]![F2].Form.[Text8]

IMPORTANT: *The F2 in all of the above refers to the name of
the subform CONTROL on the main form. *The name of the
subform control may or may not be different from the name of
the form object displayed in the subform control.

--
Marsh- Hide quoted text -

- Show quoted text -

Thank you very much Marsh
To get the value the following worked - [Forms]![F1]![F2].Form.[Text8]

As far as the hiding all the tabs in the Tabbed Control box I think I
need to give a little more explanation. What I was planning to do was
to hide all of the tabs at once. Then I would make only one tab
visible based on some criteria the user inputs. Therefore at any one
time only one tab would be visible to the user based on some criteria
they selected. I know how to make the one tab visible but I do not
know how to hide all the tabs at once unless I do them individually.

You would need to make each one invisible:

Dim pg As Page
For Each pg In Me.TabCtl0.Pages
pg.Visible = False
Next pg

Remember that you can not make something invisible if it or
something in it has the focus.

--
Marsh

Reply With Quote
  #5  
Old   
BEETHOVEN
 
Posts: n/a

Default Re: Tabbed Control Box – Hide Pages and acquire Value - 04-21-2011 , 07:03 AM



On Apr 20, 4:48*pm, Marshall Barton <marshbar... (AT) wowway (DOT) com> wrote:
Quote:
BEETHOVEN wrote:
On Apr 19, 11:22*pm, Marshall Barton <marshbar... (AT) wowway (DOT) com> wrote:
BEETHOVEN wrote:
I am using Access 2003 and 2007.

I have a Form (F1) with a sub form (F2). The form and sub form are not
linked in any way. On the sub form (F2) I have a Tabbed Control box
(TabCtl0) with 3 pages (Page1, Page2, Page3). On Page 1 I have a text
box (Text8) with a value in it.

Form – F1
* Sub Form – F2
* * *Tabbed Control box – TabCtl0
* * * * Tab – Page1
* * * * * *Text box Tab – *Text8
* * * * Tab – Page2
* * * * Tab – Page3

I have two basic questions.
1) When I load the main Form (F1) I want to hide all the pages in the
Tabbed Control box on the sub form (F2). But I do not want to do each
page separately. I want to hide all of them at once. How do I do this
with code?

2) Later I want to use the value listed on Page1 in text box Text8 to
use in the criteria for a query. Here is what I have but does not work
- [Forms]![F1]![F2]![TabCtl0]![Page1]![Text8]. What is the correct
syntax to get that value to use in the criteria for a query?

Once you make sure the focus is not anywhere in the tab
control, you can hide the entire tab control.
From the main form:
* *Me.[F2].Form.[TabCtl0].Visible = False
or from inside subform F2 (perhaps in the Load event):
* *Me.[TabCtl0].Visible = False

When referring to a control placed anywhere in a tab
control, the tab control is irrelevant. *The query criteria
would just be:
* *[Forms]![F1]![F2]![Text8]
or
* *[Forms]![F1]![F2].Form.[Text8]

IMPORTANT: *The F2 in all of the above refers to the name of
the subform CONTROL on the main form. *The name of the
subform control may or may not be different from the name of
the form object displayed in the subform control.

--
Marsh- Hide quoted text -

- Show quoted text -

Thank you very much Marsh
To get the value the following worked - [Forms]![F1]![F2].Form.[Text8]

As far as the hiding all the tabs in the Tabbed Control box I think I
need to give a little more explanation. What I was planning to do was
to hide all of the tabs at once. Then I would make only one tab
visible based on some criteria the user inputs. Therefore at any one
time only one tab would be visible to the user based on some criteria
they selected. I know how to make the one tab visible but I do not
know how to hide all the tabs at once unless I do them individually.

You would need to make each one invisible:

Dim pg As Page
For Each pg In Me.TabCtl0.Pages
* *pg.Visible = False
Next pg

Remember that you can not make something invisible if it or
something in it has the focus.

--
Marsh- Hide quoted text -

- Show quoted text -
Thanks again Marsh
The code you supplied worked.
Just in case someone that is reading this wants to make a single page
visible the code is: TabCtl0.Pages.Item(0).Visible = True. The Item(0)
refers to Page1. Page 1 has the Page Index of 0.

Gary

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.