Conditionally Display tabs based upon contents of a field in a tab

L

Lateral

Hi guys

I have 3 tabs on a form and wish to selectively display 1, 2 or 3 of the
tabs based upon the contents of a field on one of my tables so that the user
only sees the tabs that are relevant to what they are doing.

If this is not possible, is there a way to "grey" them out?

Thanks,
Regards
Greg
 
J

Jeff L

You can set the Visible property to No or if you want to grey it out,
set the Enabled property to No. The Enabled property will grey out the
Controls on the tab, not the tab itself.

Hope that helps!
 
L

Lateral

Hi Jeff

Thanks for your reply.

I found the following code on Microsofts website and modified it to suit but
I have no idea where to put it:

Private Sub Form_Open(Cancel As Integer)

If Me.[Property?] <> 0 Then
Me!pgAssignedIssues.Visible = False
Me!pgAssignedIssues.Enabled = False
End If

End Sub

I thought that I would attach it to the "On Open" Event of the main form
that contains the Tabs but it does not do anything.

The field Me.[Property?] is a Yes/No field and the tab that I do not want
displayed is named "pgAssignedIssues"...

Any help you can provide is appreciated.

Regards
Greg
 
L

Lateral

Hi Again Jeff

I have managed to get the following code working:

'If the record is a Property record then disable the Assigned tab

If Me.[Property?] <> 0 Then
Me!pgAssignedIssues.Visible = False
Me!pgAssignedIssues.Enabled = False
Me!pgOpenedIssues.Visible = True
Me!pgOpenedIssues.Enabled = True

Else

Me!pgAssignedIssues.Visible = True
Me!pgAssignedIssues.Enabled = True
Me!pgOpenedIssues.Visible = False
Me!pgOpenedIssues.Enabled = False


End If
Now, the problem is that each record has the Property? field set to either
yes of no. I want to be able to scroll throught the records via the standard
form navigation buttons and have the tabs dynamically change based upon the
Property? setting.

How do I do this?

Thanks again,
Regards
Greg
 
Top