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

Microsoft Access

Avatar of undefined
Last Comment
Joe Howard

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gozreh

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Joe Howard

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

Joe Howard

Too slow ;-)
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes