Smokeeater
Registered User.
- Local time
- Today, 11:45
- Joined
- Jan 15, 2009
- Messages
- 58
I have frmIncident that has a 2-column combo box (cmbIncidentType). Column (0) is IncidentType, Column (1) is YES/NO. This combo box feeds from a Query and currently has about 15 "types" of which 4 have a "Yes" tied to them, then rest "No".
There are situated on a TabControl (tabIncident) with 5 sheet tabs. If the Incident Type selected in the Combo Box has a corresponding "Yes" in Column (1) then all 5 sheet tabs need to be visible. If it is "No", then only three of the five are visible. Here it he current code I am using for the AfterUpdate event on the combo box:
Private Sub cmbIncidentType1_AfterUpdate()
If Me.cmbIncidentType1.Column(1) = "Yes" Then
pgEmerIncidentRpt.visible = True
pgNarrClose.visible = True
Else
pgEmerIncidentRpt.visible = False
pgNarrClose.visible = False
End If
End Sub
Here are the events tied to the form frmIncident in the AfterUpdate(), Form_Current(), and Form_Open events.
If cmbIncidentType1.Column(1) = "Yes" Then
pgEmerIncidentRpt.visible = True
pgNarrClose = True
Else
pgEmerIncidentRpt.visible = False
pgNarrClose.visible = False
End If
End Sub
When I open the form is will set the proper sheet tabs that need to be visible, however once I cycle to the next record, or select a different IncidentType, even one with a "YES' in column (1), it will only show the (3) sheet tabs. I can never get it to show all 5.
In the code, the only (2) sheet tabs that need to visible = true or visible = false are shown, starting with "pg".
Thanks so much!
There are situated on a TabControl (tabIncident) with 5 sheet tabs. If the Incident Type selected in the Combo Box has a corresponding "Yes" in Column (1) then all 5 sheet tabs need to be visible. If it is "No", then only three of the five are visible. Here it he current code I am using for the AfterUpdate event on the combo box:
Private Sub cmbIncidentType1_AfterUpdate()
If Me.cmbIncidentType1.Column(1) = "Yes" Then
pgEmerIncidentRpt.visible = True
pgNarrClose.visible = True
Else
pgEmerIncidentRpt.visible = False
pgNarrClose.visible = False
End If
End Sub
Here are the events tied to the form frmIncident in the AfterUpdate(), Form_Current(), and Form_Open events.
If cmbIncidentType1.Column(1) = "Yes" Then
pgEmerIncidentRpt.visible = True
pgNarrClose = True
Else
pgEmerIncidentRpt.visible = False
pgNarrClose.visible = False
End If
End Sub
When I open the form is will set the proper sheet tabs that need to be visible, however once I cycle to the next record, or select a different IncidentType, even one with a "YES' in column (1), it will only show the (3) sheet tabs. I can never get it to show all 5.
In the code, the only (2) sheet tabs that need to visible = true or visible = false are shown, starting with "pg".
Thanks so much!