No design changes in MDE

  • Thread starter Thread starter Mike Revis
  • Start date Start date
M

Mike Revis

Right, everyone knows that.

My little app has a report that has to print to a specific printer on the
network. It is a serial/thermal printer attached to one of the computers on
the network.

When I develop the app I set the specific printer to Warehouse1\thermal1.

The printer Warehouse1\Thermal1 is installed on each individual computer.

After making mde and distributing to others on the network they all get the
error that "this report was formatted for the printer Warehouse1\Thermal1 do
you want to use the default printer instead" (kinda paraphrasing here).

I can go through setup and make it work once but the changes don't stay
changed. I can change the default printer to Warehouse1\Thermal1 and it will
work but no one wants to have to change the default printer everytime.

When I distribute the frontend as a mdb I only have to make the changes once
and it's ok.

Thanks for any ideas?

Mike
 
You can set the default printer in the app, and then reset the old
default when you are done. As a bonus, you can also detect if the
expected printer is there and throw an error.

Access does not have built in printer control, and as far as I know it
will only print to the default printer (at least in 2000), so you must
change the default if you want to print to something else, then flop
back.

You should be able to find something on the web to help do this,
probably at mvps.org, to get started.

If you are interested, I could try to whip up something to do this,
but the gist of it is that you need to read the registry, parse the
printers string it returns, read in a different key to get the current
default, swap the two, print, and the swap back.

-Andrew Backer
 
To add to Andrew's comments, there is a Printer object in the more recent
versions (2002 and 2003). You could therefore save the report set up for the
default printer before you create the MDE. Then use the Report_Open event to
lookup a table where you stored the printer used last time, and assign it if
the printer is still available. If not, or if the printer was never
assigned, pop up a form to get the preferred printer, write it to the table
for next time, and assign it for the report.

The end result is that each workstation can assign its own specific printer
for the report, even in an MDE.
 
Back
Top