VB6 Data table

I have created a vb6 app which consists of a form with 4 application titles and 2 checkboxes next to each title. What I need is a way to trigger certain events based on what checkboxes are ticked, eg

chk1 ticked, chk2 clear > set action1
chk1 ticked, chk2 ticked > set action2
chk1 clear, chk2 clear > set action3

What I am looking for is an elegant solution that avoids a whole bunch of If...Then statements. Part of the reason I need this is because I would like a msgbox to pop up to explain to the user that they have requested X action with Application1, Y action with application2 and Z action with application3 before commencing and and acting on the request.
Sounds fairly straightforward but I have been struggling to think of a way to do this that I'm happy with!

Your thoughts and suggestions are appreciated as always!

NewsInternationalLtdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MoeterCommented:
Try this, I have choosen On Click, but you can use it whenever you want

two check boxes

Private Sub Check1_Click()
    If Check1.Value = 1 And Check2.Value = 0 Then
        MsgBox "First checked, second not"
    ElseIf Check1.Value = 1 And Check2.Value = 1 Then
        MsgBox "Both checked"
    ElseIf Check1.Value = 0 And Check2.Value = 0 Then
        MsgBox "Both Not checked"
    End If
End Sub
0
mikeydmCommented:
select case Check.1 + 2* Check.2
  case 0
    action3
  case 1
    action1
  case 2
    MsgBox "Not possible to check 2 and not 1"
  case 3
    action 2
end select

Of course, this is expandable to more check boxes (+ 4*Check.3 + 8*Check.4)

0
NewsInternationalLtdAuthor Commented:
Thanks.
The first solution is the way I have it at present.
I am intrigued by the second though.

Supposing the checkboxes are called AppOffice and AppFP. What is the syntax used for this? I'm trying to figure out exactly how it works.
0
mikeydmCommented:
True has a value of -1 and false is 0; so:

Select Case AppOffice.Value + 2*AppFP.Value
  Case -1
    MsgBox ("You have selected Office")
  Case -2
    MsgBox ("You have selected FP")
  Case -3
    MsgBox ("You have selected both Office and FP")
  Case Else
    MsgBox ("Don't just stand there; do something") ' Put in what you want
End Select
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NewsInternationalLtdAuthor Commented:
Excellent, this is what I was looking for. However I would point out that the Case statements create a values of 1, 2, or 3 rather than their negetives. Still, the same principle so thanks.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.