Link to home
Start Free TrialLog in
Avatar of cansevin
cansevin

asked on

Code for option box

I am currently using the below code for an option box when the value is 1. I would like to add 3 and 4 to the code. So if Frame109 value is 1, 3, or 4 then the code will take place. I tried doing 1, 3, 4 and 1; 3; 4 and both didn't work.

Private Sub Frame109_AfterUpdate()
If Me.Frame109.Value = 1 Then
 Me.chkBooked.Visible = True
 Me.frmReachOutSalesSub.Visible = True
Else
 Me.chkBooked.Visible = False
 Me.frmReachOutSalesSub.Visible = False
End If
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gozreh
Gozreh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Use the Select Case structure.

Sub Private Sub Frame109_AfterUpdate()
    Select Case Me.Frame109.Value
        Case Is = 1, 3, 4
            Me.chkBooked.Visible = True
            Me.frmReachOutSalesSub.Visible = True
        Case Else
            Me.chkBooked.Visible = False
            Me.frmReachOutSalesSub.Visible = False
    End Select
End Sub

Open in new window

Too slow ;-)