Solved

msgbox vbyesno

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

914 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

17 Experts available now in Live!

Get 1:1 Help Now