[AccessD] Dynamic Default Printer

Ryan W wrwehler at gmail.com
Mon Oct 23 10:36:53 CDT 2023


Hey all,
  I've got what was once just a lone Zebra printer to print labels and all
the reports that used to generate those labels were bound to that specific
printer.

  Now we are considering adding more so we don't just have one.

  I was thinking of setting them all up as shared TCP/IP printers off a
windows server, and depending on the department or side of the building
connect those workstations to that specific printer.

  I think the problem there will be that they cannot all be named "Zebra
Printer" (even if I try and change the name on the local machine it tries
to change the share name).  So we have Zebra North, Zebra South, Zebra East.

  I'm tinkering around with catching the current Application.Printer name,
changing it to the appropriate Zebra name and then back when the report for
the labels is closed.

 This seems to work OK if I wrap DoCmd.OpenReport is some code to change
the default printer (or a function that does the change, open and revert).

 What I was wondering is, is there a way to do this in the report_load,
report_open, report_close or report_unload event? So far when I do that the
paper size exceeds the label size (probably because it's trying to use the
'actual default printer' properties, which were set as the report opened
and the code had yet to run?)


More information about the AccessD mailing list