Link to home
Create AccountLog in
Avatar of GoldenJag
GoldenJag

asked on

Interaction Choose Method

Could someone give me an example of how to use the choose method in vb?

Thanks!
Avatar of GoldenJag
GoldenJag

ASKER

Better yet, i was looking for a way to have a user choose between two options.  I was wondering if there is a way to do this without creating another form and putting two radio buttons on it...etc.

is that what the choose method does?
SOLUTION
Avatar of Computron
Computron

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Leigh Purvis
You'll still need a method of determining the arguments for the choose function.
(Bar in mind that every argument is evaluated for it).

For options that might change a combo or listbox is a bit more normal.
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
"i was looking for a way to have a user choose between two options."

You could use the MsgBox() function and have the user select Yes/No to indicate their preference for the first/second option:

Private Sub Command1_Click()
    Dim msg As String
    msg = "How often do you like your system to crash?" & vbCrLf & vbCrLf & _
        "(1) Just before I click the Save button on important documents." & vbCrLf & _
        "(2) Just before I hit Print on the bosses reports." & vbCrLf & vbCrLf & _
        "Select YES for (1) ... or ... NO for (2)"
       
    Dim result As Integer
    result = MsgBox(msg, vbYesNo, "Crash Preference")
    Select Case result
        Case vbYes
            MsgBox "You selected Option 1"
           
        Case vbNo
            MsgBox "You selected Option 2"
           
    End Select
End Sub