Conditional visibility of a Tab Page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to hides certain pages on my tab control based on the value in a field
on another open form. I think it should go in the put code in an Open Form
event of that second form.

Can anyone give me an example or point me to where I might find some examples?

Thanks so much!
 
I'm assuming you are putting the code on the form with the tabs. On the
OpenForm Event use the following:

Private Sub Form_Open(Cancel As Integer)
if forms!frmName!Condition = "Condition Met" then
me.tab1.visible = true
else
me.tab1.visible=false
End Sub

This should do what you want.
 
KADL said:
I need to hides certain pages on my tab control based on the value in a field
on another open form. I think it should go in the put code in an Open Form
event of that second form.

Can anyone give me an example or point me to where I might find some examples?


Here's an example, but I don't know how well it relates to
what you're trying to do.

Me.tabCtl.Pages(2).Visible = (Forms!otherform.textbox = 7)
 
I figured it out, finally.

Thefollowing goes in the open form event:

If [Forms]![formname]![controlname] = certainvalue Then
Me.tabcontrol.Pages!pagename.Visible = False

My code is the following:

If [Forms]![frmEmpGroupLookup]![cboGroup] > 2 Then
Me.TabCtl15.Pages!AcademyUniform.Visible = False
 
Back
Top