Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Default Printer, But Reports Not Working

Status
Not open for further replies.

SpankYou

Programmer
Feb 24, 2003
211
GB
Basically I have a search, and depending on what you search by, you can print of a number of reports. Now, I wanted to bring up a print dialogue box, so that you can select which printer you print to, but I have a problem. Basically I can be printing up to five reports sequentially, and of course I wouldn't want to bring the Print Dialogue box up five times. So What I decided to do is create a seperate form that acts as a dialogue box, and holds a listbox, which contains all the printers, connected to your computer. Now as soon as you select a printer, the code works a charm and the default printer is changed. But as soon as you press ok to print, the reports (although set to default printer) still regard the printer that was default when the program was opened, as the default printer. Is there a line of code that could refresh the default printer for the program at all?

Thanks for any help

Sam

"You couldn't fool your mother on the foolingest day of your life if you had an electrified fooling machine." - Homer
 
Do you supply the printer name in line that prints out the report. i take it you are doing this in Access. if so I’m not sure if this is possible but it might. This is how its done in excel, i suspect there something very like this in access
Code:
  ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=True, _
        ActivePrinter:="NameOFYourPrinterHere", Collate:=True
[/cdoe]

Simon
 
Hey Simey,

Yeah I am doing this in access. I don't put the printer name in the line that prints out the report, to tell the truth I didn't know that was possible. I'll have a play around with the code above and tell you how it goes.

Thanks

Sam

"You couldn't fool your mother on the foolingest day of your life if you had an electrified fooling machine." - Homer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top