![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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? |
#3
| |||
| |||
|
|
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 - |
#4
| |||
| |||
|
|
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. |
#5
| |||
| |||
|
|
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 - |
![]() |
| Thread Tools | |
| Display Modes | |
| |