We help IT Professionals succeed at work.

Code for option box

cansevin
cansevin asked
on
243 Views
Last Modified: 2014-05-21
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

Comment
Watch Question

Software Developer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
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

CERTIFIED EXPERT

Commented:
Too slow ;-)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.