How To Make A VBA Message Box Yes No

 

Continuing on with our VBA message box theme, here is how
to create a “VBA message box yes no”

The message box can be used like a function to return a value.

Here I am going to return a value to determine if the user clicked
“yes” or “no”.

For this I am going to set up a VBA Procedure to test with:

Sub GetReponse()
    
    Dim intChoice As Integer
    
    intChoice = MsgBox("Would you like to proceed?", vbYesNo, "Get Response")

    Select Case intChoice
        Case vbYes
            DoCmd.OpenForm "Yes"
        Case vbNo
            DoCmd.OpenForm "No"
    End Select

End Sub

 


Comments are closed.