rcleon
asked on
MsgBox is printing when I press OK or Cancel.
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
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
If result= vbOK Then
'printing report
Else ' if user clicks on Cancel nothing will happen
'canceling report
End If
-FA
'printing report
Else ' if user clicks on Cancel nothing will happen
'canceling report
End If
-FA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How far are we on thisone Rafael ?
Nic;o)
Nic;o)
use
result = msgbox(...)
and check the result in a If-Then-End if statement
-FA