Solved

msgbox vbyesno

Posted on 2002-05-14
3
1,597 Views
Last Modified: 2008-11-25
simple, i have just forgotten.

i want a yes/no msgbox to do the following in my terms

if msgbox = yes then
msgbox "You clicked YES"
else if no
msgbox "You clicked NO"
end if
0
Comment
Question by:bolox
[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
3 Comments
 
LVL 33

Accepted Solution

by:
hongjun earned 50 total points
ID: 7008381
Try this
Dim MsgResult As VbMsgBoxResult

MsgResult = MsgBox("Are you sure", vbApplicationModal + vbInformation + vbYesNo, "Prompt")
' yes is clicked
If MsgResult = vbYes Then
    msgbox "You clicked YES"
Else
    msgbox "You clicked NO"
End If


hongjun
0
 
LVL 1

Author Comment

by:bolox
ID: 7008392
thats the one,

very quick also

Ta
0
 
LVL 2

Expert Comment

by:vbDoc
ID: 7009277
Here is a shorter version that you might look at.....

' ***********************************************
Select Case MsgBox("Are you sure", vbInformation + vbYesNo + vbDefaultButton1, "Prompt")
    Case vbYes
    Case vbNo
End Select
' ***********************************************

vbDoc
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month10 days, 17 hours left to enroll

631 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