Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Msgbox Yes No

Posted on 2006-07-06
4
Medium Priority
?
594 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

636 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