By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,578 Members | 825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,578 IT Pros & Developers. It's quick & easy.

Extended question on tabbed pages--Rick please help

P: n/a
kev
Hello,

I posted a question a while ago on tabbed pages, how to set it to
invisible when the text box is empty.It was answered by Rick and the
code ran perfectly. However, i tried using the same code for another
scenario and it gives me compile error:method or data member not found.

My scenario is i have a nested tab page.My main tabbed page has 4 tabs,
About, SafetyLevel1,SafetyLevel2,SafetyLevel3. Inside this main, i
created a subform(which is another tab page that contains many tabs)
for each main tab namely SafetyLevel1,SafetyLevel2,SafetyLevel3.

What i want to achieve is that, when the subform which is the inner tab
contains no records at all, the main tab page which is Safety Level one
to be disabled/appear invisible.

My main tab pages are pgSL1,pgSL2,pgSL3 and the tab control is tabMain.
The corresponding subform for each tab is
frmDisplaySL1,frmDisplaySL2,frmDisplaySL3.

Please advise me on what to do i am at a lost here.
Firstly, i did not prefer to create a nested tabbed page however the
idea of placing three command buttons at the bottom of the form as
Safety1, Safety2,Safety3 does not seem much user friendly as users need
to click each button in order to see each level.

Any suggestion is very much welcomed. Thanks again.

Jan 16 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
kev wrote:
Hello,

I posted a question a while ago on tabbed pages, how to set it to
invisible when the text box is empty.It was answered by Rick and the
code ran perfectly. However, i tried using the same code for another
scenario and it gives me compile error:method or data member not
found.

My scenario is i have a nested tab page.My main tabbed page has 4
tabs, About, SafetyLevel1,SafetyLevel2,SafetyLevel3. Inside this
main, i created a subform(which is another tab page that contains
many tabs) for each main tab namely
SafetyLevel1,SafetyLevel2,SafetyLevel3.

What i want to achieve is that, when the subform which is the inner
tab contains no records at all, the main tab page which is Safety
Level one to be disabled/appear invisible.

My main tab pages are pgSL1,pgSL2,pgSL3 and the tab control is
tabMain. The corresponding subform for each tab is
frmDisplaySL1,frmDisplaySL2,frmDisplaySL3.

Please advise me on what to do i am at a lost here.
Firstly, i did not prefer to create a nested tabbed page however the
idea of placing three command buttons at the bottom of the form as
Safety1, Safety2,Safety3 does not seem much user friendly as users
need to click each button in order to see each level.

Any suggestion is very much welcomed. Thanks again.
What event needs to make this decision? When the main form is opened? When you
navigate between records in the main form? Assumining the latter you use the
Current event of the main form to test the RecordCount of the subform's
Recordset. When zero you can hide the tab page on the main form, but you will
first have to set focus to a control NOT on that tab page.

If Me.SubformControlName.Form.RecordsetClone.RecordCo unt = 0 Then
Me.SomeControl.SetFocus
Me.tabMain.Pages("pgSL1").Visible = False
End If

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 16 '07 #2

P: n/a
kev
Hi Rick,

Let me explain in detail here. In the main form, i have placed an
unbound combo box cboID in which it lists all the ID's available. When
u make a selection, the corresponding records are displayed in the 4
main tabbed pages:About, SafetyLevel1,SafetyLevel2,SafetyLevel3.

Under each tab, there is a subform which is made of a tabbed
page.Generally, d navigation as below:
tabMain/pgSL1/frmDisplaySL1
(SUBFORM)/tab1/pgGeneral,pgAccess,pgElectrical (txtchemical is the
first control)
tabMain/pgSL2/frmDisplaySL2(SUBFORM)//tab2/pgFire,PgSafety(txtseismic
is the first control)
tabMain/pgSL3/frmDisplaySL3(SUBFORM)//tab3/pgRadiation,pgVentilation
(txtpunch is the first control)

You have provided me the code below:
If Me.SubformControlName.Form.RecordsetClone.RecordCo unt = 0 Then
Me.SomeControl.SetFocus
Me.tabMain.Pages("pgSL1").Visible = False
End If

I am not sure SubformControlName. stands for? is it supposed to be the
subform's name?
Me.SomeControl? what does it refer to?

I am really at wits end here, please help.

Can i email you personally?

Thanks a lot.

Rick Brandt wrote:
kev wrote:
Hello,

I posted a question a while ago on tabbed pages, how to set it to
invisible when the text box is empty.It was answered by Rick and the
code ran perfectly. However, i tried using the same code for another
scenario and it gives me compile error:method or data member not
found.

My scenario is i have a nested tab page.My main tabbed page has 4
tabs, About, SafetyLevel1,SafetyLevel2,SafetyLevel3. Inside this
main, i created a subform(which is another tab page that contains
many tabs) for each main tab namely
SafetyLevel1,SafetyLevel2,SafetyLevel3.

What i want to achieve is that, when the subform which is the inner
tab contains no records at all, the main tab page which is Safety
Level one to be disabled/appear invisible.

My main tab pages are pgSL1,pgSL2,pgSL3 and the tab control is
tabMain. The corresponding subform for each tab is
frmDisplaySL1,frmDisplaySL2,frmDisplaySL3.

Please advise me on what to do i am at a lost here.
Firstly, i did not prefer to create a nested tabbed page however the
idea of placing three command buttons at the bottom of the form as
Safety1, Safety2,Safety3 does not seem much user friendly as users
need to click each button in order to see each level.

Any suggestion is very much welcomed. Thanks again.

What event needs to make this decision? When the main form is opened? When you
navigate between records in the main form? Assumining the latter you use the
Current event of the main form to test the RecordCount of the subform's
Recordset. When zero you can hide the tab page on the main form, but you will
first have to set focus to a control NOT on that tab page.

If Me.SubformControlName.Form.RecordsetClone.RecordCo unt = 0 Then
Me.SomeControl.SetFocus
Me.tabMain.Pages("pgSL1").Visible = False
End If

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jan 17 '07 #3

P: n/a
kev wrote:
Hi Rick,

Let me explain in detail here. In the main form, i have placed an
unbound combo box cboID in which it lists all the ID's available. When
u make a selection, the corresponding records are displayed in the 4
main tabbed pages:About, SafetyLevel1,SafetyLevel2,SafetyLevel3.

Under each tab, there is a subform which is made of a tabbed
page.Generally, d navigation as below:
tabMain/pgSL1/frmDisplaySL1
(SUBFORM)/tab1/pgGeneral,pgAccess,pgElectrical (txtchemical is the
first control)
tabMain/pgSL2/frmDisplaySL2(SUBFORM)//tab2/pgFire,PgSafety(txtseismic
is the first control)
tabMain/pgSL3/frmDisplaySL3(SUBFORM)//tab3/pgRadiation,pgVentilation
(txtpunch is the first control)

You have provided me the code below:
If Me.SubformControlName.Form.RecordsetClone.RecordCo unt = 0 Then
Me.SomeControl.SetFocus
Me.tabMain.Pages("pgSL1").Visible = False
End If

I am not sure SubformControlName. stands for? is it supposed to be the
subform's name?
Me.SomeControl? what does it refer to?

I am really at wits end here, please help.
A subform is a form hosted inside another form and it is contained within a
subform control on the parent form. If you used drag and drop or the wizard to
create the subform then the subform control will have the same name as the form
it is hosting (usually), but that is not guaranteed. The proper syntax to refer
to "stuff" on the subform is to use the Form property of the subform control.
The name of the form inside the subform control does not come into play at all.

In Access 97 there was an obvious difference between the subform control and the
form it contained. Then they "improved" this in Access 2000 and newer users
have been confused ever since.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Jan 17 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.