Hello people.
The idea behind the following code is to open a report HIDDEN, change it's printer and tray, then open the report again normally so it prints.
So here's my problem: on the last line of code (OpenReport), the report will show on screen! It should be sent straight to the printer. I tried using acHidden and did some trial and error on parameters, I can't find it out. Is there something wrong with the way I open it the first time around?Code:'open report hidden DoCmd.OpenReport stDocName, view:=acPreview, WindowMode:=acHidden, WhereCondition:="[NoPatient] = 8" 'set new printer (this part works) Set Reports(stDocName).Printer = Application.Printers(strPrinterToUse) 'set paperbin to manual feed (this also works) Reports(stDocName).Printer.PaperBin = 4 'open report normally so it prints DoCmd.OpenReport stDocName, WhereCondition:="[NoPatient] = 8"
I'm happy it does select the desired printer and tray, but having the report (which is currently an invoice being printed out) pop out and show every time is somehow annoying.
My code seems to be following quite well different articles I've read.
Any help appreciated!
Thanks!





Reply With Quote