Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MsgBox

Posted on 1999-07-12
4
Medium Priority
?
317 Views
Last Modified: 2010-05-02
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.
0
Comment
Question by:mrcool4444
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
Jaysin28 earned 0 total points
ID: 1523962
REsponse = MsgBox("Text", VBYEsNO + vbQuestion

If response = VByes then
   Unload Me
else
   frm.Backcolor = vbGreen
end if
0
 
LVL 1

Expert Comment

by:Jaysin28
ID: 1523963
OOPs... Forgot other parens...

REsponse = MsgBox("Text", VBYEsNO + vbQuestion)
0
 

Expert Comment

by:TT
ID: 1523964
You can Dim Response as VbMsgBoxResult :

Dim Response as VbMsgBoxResult
0
 

Expert Comment

by:RandomTask
ID: 1523965
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.

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question