Solved

Msgbox Yes No

Posted on 2006-07-06
4
557 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

863 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

27 Experts available now in Live!

Get 1:1 Help Now