We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

MsgBox is printing when I press OK or Cancel.

rcleon
rcleon asked
on
Medium Priority
469 Views
Last Modified: 2008-02-26
Hi Guys,

What is wrong with this code.

MsgBox " Please load Avery labels No. 5160 in the printer. Then press OK ", vbApplicationModal + vbOKCancel + vbInformation, "Title Company Labels"

The idea is when the user press OK the report prints when the user press cancel the report should not print the msgbox disapears and the user is return to the application.

But right now the report prints when you press OK or Cancel or Close the MsgBox.

Please help.

Rafael
Comment
Watch Question

CERTIFIED EXPERT

Commented:
Hi,
use

result = msgbox(...)

and check the result in a If-Then-End if statement

-FA
CERTIFIED EXPERT

Commented:
   If result= vbOK Then  
        'printing report
    Else ' if user clicks on Cancel nothing will happen
        'canceling report
    End If


-FA
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Commented:
How far are we on thisone Rafael ?

Nic;o)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.