borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Printing the contents of a Picturebox in Visual basic)Next Topic (Printing Blues) New Topic New Poll Post Reply
AndreaVB Forum : Printing : Different printers in access
Poster Message
levi
Level: Guest


icon Different printers in access

I have a project where I am using 3 different printers I need to be able to create something that will set the printer for each form before it prints. I have done allot with MSAccess but little with the printing.

Would this be an API call if so how?  

28-10-2004 at 01:42 AM
| Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: Different printers in access

Hi,
A lot depends on which version of Access you are using as to the possible alternatives to your problem. The biggest drawback is that whatever version you cannot set a printer for an Access Report BEFORE the Report is open - you have to open it in Preview mode first.
Presuming that you are not using the built in toolbars (otherwise you just leave it to them) and that you call the Report from a Form then the easiest route is to have a Common Dialog Control on that Form and a custom toolbar for the Report Preview which you can then use to call the Printer Dialog from the CDL on your form. Your users can then choose the Printer. But beware, this can change the default printer for your users PC so they should be aware of this.



____________________________
multi-tasking - the ability to hang more than one app. at the same time.

28-10-2004 at 07:55 AM
View Profile Send Email to User Show All Posts | Quote Reply
levi
Level: Guest

icon Re: Different printers in access

I am using AC2000
But I am printing forms not reports does this matter?

28-10-2004 at 08:59 PM
| Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: Different printers in access

Ah - In that case I presume that you call DoCmd.PrintOut from a Button_Click Event. So put the CommonDialog Control on your Form and in your Event procedure just before the PrintOut call add the line -
CommonDialog1.ShowPrinter
This will give users the opportunity to choose Printer before the PrintOut executes.
But - remember, this will change the computers default printer unless you set the CommonDialog Control property "PrinterDefault" to False - by default there will be a Tick against this property in the Property Pages (Not the standard Access Property Page that comes up when you select Properties after a right click on the control in Design, select "CommonDialog Object" at the top of that PopUp, then "Properties".)
Whilst you are setting these properties it is a good idea to put a Tick against "CancelError", which by default is set to false. This will enable you to trap a users click on the "Cancel" button and exit the procedure without running the PrintOut.
Hope that helps.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

29-10-2004 at 08:37 AM
View Profile Send Email to User Show All Posts | Quote Reply
levi
Level: Guest

icon Re: Different printers in access

cool I think i am going to use both things that you suggedted in that I am going to use a report and call to it from a form and have the printer selected then



Thanks

01-11-2004 at 02:45 AM
| Quote Reply
AndreaVB Forum : Printing : Different printers in access
Previous Topic (Printing the contents of a Picturebox in Visual basic)Next Topic (Printing Blues) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder