I have a button that prints a report and runs a query to update the records whose invoice was printer.
I have the report setup to print on a specific printer.
It's been working fine for months, then all of a sudden yesterday it printed on our mono machine instead of our colour one. Which meant I had to go into the queries and reset the ones that had been updated.
When I opened the report in design view and it said the specific printer was unavailable, so I reselected it (exactly the same IP, name, everything), saved and it ran fine.
This morning, same thing happened again!
I can't have this happening every day so I'm wondering if there's any VBA I can add to the onPage event to make sure it selects the right printer?
Thanks
Mandi
Edit:
I just found this code:
But it would be easier if I could specify it using the IP address instead of the name, as there's 20+ computers and I can't be sure that everyone has the same printer name setup, but obviously the IP doesn't change.
I have the report setup to print on a specific printer.
It's been working fine for months, then all of a sudden yesterday it printed on our mono machine instead of our colour one. Which meant I had to go into the queries and reset the ones that had been updated.
When I opened the report in design view and it said the specific printer was unavailable, so I reselected it (exactly the same IP, name, everything), saved and it ran fine.
This morning, same thing happened again!
I can't have this happening every day so I'm wondering if there's any VBA I can add to the onPage event to make sure it selects the right printer?
Thanks
Mandi
Edit:
I just found this code:
Code:
reports(0).Printer.devicename = "My Printer"
Comment