?
Solved

Msgbox Yes No

Posted on 2006-07-06
4
Medium Priority
?
588 Views
Last Modified: 2012-06-27
I have a yes/no msgbox - I want different actions to happen dependant on the click of yes or no - how do I go about this ?
0
Comment
Question by:Carl2002
[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
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Natchiket earned 1000 total points
ID: 17049171
Assuming you are using VBA

If Msgbox("Message",vbQuestion+vbYesNo,"Title bar") = vbYes Then
  'Yes click actions
Else
  'No click actions
End IF
0
 
LVL 14

Assisted Solution

by:bluelizard
bluelizard earned 1000 total points
ID: 17049173
when you call msgbox, the returned value is the button that was clicked:

if msgbox("do you want such and such?", vbyesno) = vbyes then
  ' user clicked yes: do yes stuff
else
  ' user clicked no: do no stuff
end if


--bluelizard
0
 
LVL 14

Expert Comment

by:bluelizard
ID: 17049187
tie! ... well, anyway, we seem to agree...! ;-)
0
 
LVL 17

Expert Comment

by:Natchiket
ID: 17049342
vbYes
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

770 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