Solved

msgbox vbyesno

Posted on 2002-05-14
3
1,589 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
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now