Link to home
Start Free TrialLog in
Avatar of mrcool4444
mrcool4444

asked on

MsgBox

How do I get responses from MsgBoxes?  What is the form for getting MsgBoxes responces?  And how do I make Elses with message boxes?  The way I am trying to do it is like this:

MsgBox "Text", VbYesNo
If VbYes, Then
Unload Me
Else: form1.BackColor = VbGreen
End If

How can I make this code work?  Thanx.
ASKER CERTIFIED SOLUTION
Avatar of Jaysin28
Jaysin28

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jaysin28
Jaysin28

OOPs... Forgot other parens...

REsponse = MsgBox("Text", VBYEsNO + vbQuestion)
You can Dim Response as VbMsgBoxResult :

Dim Response as VbMsgBoxResult
If you want to design your own input/msg box just create a new form with the desired controls etc. And pass the desired results back to the calling function with some local access functions, just like in an ActiveX control.