Is there any way to have the message box ask yes or no questions?

G

Guest

I am trying to set up a macro so if they answer yes it sends them to one
place and if the answer no to another.
 
S

Steve Schapel

Donbenz,

Can you please five more details? Who is "they"? Where are they
working? What is 'yes' and 'no' related to? Where do you want to send
them?
 
G

Guest

It is database keeping track of incoming inventory. The yes or no question
is a msgbox macro and is asking if the part has passed the inspection.
Whoever is reveiving the parts answers yes then they will continue on with
the other parts, but if they answer no I need them to be sent to another
table to record the information on the faulty part. I would also like to
isolate the message boc to the tenth row instead of the whole column.
 
G

Guest

Here is somrhting I got from Ken Snell in a previous post. I have not tested
this but Ken is very sharp so I am sure it works.

Use the Condition part of the macro. You can specify the buttons and read
the result by using numbers for the different buttons.

For example, if you want the user to tell you yes or no to "Do you want to
do this?":

Condition: Msgbox("Do you want to do this?", 4, "Confirm Action") = 6

The above will be true if the user clicks the Yes button.

Macros don't recognize vbYes and vbNo, so you use the actual numbers for
them. Otherwise, you use the same expression to test the user's answer, and
put the expression in the Condition column of the macro (32 is the value of
vbQuestion, 4 is the value of vbYesNo, 7 is the value of vbNo, 6 is the
value of vbYes, 0 is the value of vbDefaultButton1, 256 is the value of
vbDefaultButton2, and so on):

7=MsgBox("Do you want to continue?", 32+4+256, "Continue?")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top