Solved

msgbox vbyesno

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

729 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