I'm trying to print a form when a button is a button is clicked on another form. However, I am getting an error message during run-time causing my program to crash.
On the printreceipt form there is a PrintForm Object
I want to print the "PrintReceipt" form without having to place a button on the form.
Code in print button
PrintReceipt.PrintForm1.Print()
Error Message
The window being printed must be visible and contain focus
Thanks for any help you can provide
Add these two lines on the top of the form:
It will work perfectly.