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:
Quote:
kev wrote:
Quote:
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