Solved

msgbox vbyesno

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

773 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