Hi there,
I have created an Access 2002 db which contains several reports. Some
reports need to be printed on a Laserjet and others on a Labelprinter.
One of my clients wants to be able to print the same reports to 3
different laserjets and to 3 different labelprinters. (They work with
the db on 3 different units each with their own Laserjet and
Labelprinter)
For each unit there is a copy of all the reports.
The client can make a unit profile in which the specific printers for
that unit are defined.
When the client wants to print a report, I check whether the printer
defined for the unit is the same as the printer defined in the report.
I use DevNames for that.
To prevent the report having to open in Design view every time the
client prints, (they print a lot every day), I save the string with
the devicename, driver and port into a table for each report and then
check whether that is the same as the devicename, driver and port
defined for that unit.
In principle this works really well.
One of the main problems we seem to have now is when a printer has
been defined with the same name as the printer for a specific unit,
but in fact is not that printer. (all 3 Laserjets are the same kind
and all 3 labelprinters as well, so the drivers are the same and often
the port as well). Of course different printers should have different
names, but at the moment that is not the case.
With my check it seems as if the printer is the right one, so the
report just prints, without resetting the DevNames. But then the
report can't find the specific printer and then prints to the Default
Windows Printer. That is fine in itself. But when the right printer
has been defined on the workstation later on, even though my code does
go through resetting the DevNames, the report does not change from
Default Printer. (Whereas if I use this code to set the report to
Default Printer and then reset it using code to Use Specific Printer
it works like a charm)
What can I do to either:
- Prevent Access from setting a report to Default Printer on it's own
volition.
- Check whether a report is set to Default Printer and somehow change
that (which is actually what I'm doing but doesn't seem to work)
- Clear the printer settings of a report and set them all over again
(start with a clean slate as it were)
Any suggestions are very welcome.
Thanks
Esmee