dackedyman
New member
- Local time
- Today, 08:41
- Joined
- Aug 3, 2019
- Messages
- 9
I am new to VBA. I used code from this site to make subforms visible or invisible based off the selection from a combo box. The issue I am having is that if I select "Therapist" from the Combo12 combo box, the SpecialitiesSubFrm and ModelSubFrm are visible (which is what I want), but they are visible for everyone, including the "Providers" (they should not be visible for the Providers).
I want certain controls to be visible when I user selects "Therapist" from the Combo12 combo box. Likewise, I want certain controls to be invisible if the user selects the Provider option from the Combo12 combo box.
Here is a copy of the code I now have:
Private Sub Combo12_AfterUpdate()
If Me.Combo12.Text = "Provider" Then
Me.SpecialitiesSubFrm.Visible = False
Me.ModelSubFrm.Visible = False
ElseIf Me.Combo12.Text = "Therapist" Then
Me.SpecialitiesSubFrm.Visible = True
Me.ModelSubFrm.Visible = True
End If
End Sub
I want certain controls to be visible when I user selects "Therapist" from the Combo12 combo box. Likewise, I want certain controls to be invisible if the user selects the Provider option from the Combo12 combo box.
Here is a copy of the code I now have:
Private Sub Combo12_AfterUpdate()
If Me.Combo12.Text = "Provider" Then
Me.SpecialitiesSubFrm.Visible = False
Me.ModelSubFrm.Visible = False
ElseIf Me.Combo12.Text = "Therapist" Then
Me.SpecialitiesSubFrm.Visible = True
Me.ModelSubFrm.Visible = True
End If
End Sub