Solved

Msgbox Yes No

Posted on 2006-07-06
4
539 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
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Natchiket earned 250 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 250 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

Highfive Gives IT Their Time Back

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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…

747 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

9 Experts available now in Live!

Get 1:1 Help Now