[AccessD] Changing Printer

Eric Barro ebarro at verizon.net
Wed Apr 4 17:41:02 CDT 2007


Rocky,

LOL! Guess what...I have a web-based app developed in C# that calls
Bartender.exe as a COM object. I provide the default printer in code this
way...

btFormat = btApp.Formats.Open(labelFormatFileName, false, labelPrinter)

Where labelFormatFileName and labelPrinter are string values.

Since you don't know the printer name you can simply present him with a
select printer form that pulls up all available connected printers and then
pass the value from the combobox to your function so that it passes it on to
the labelPrinter variable.

Eric

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
Beach Access Software
Sent: Wednesday, April 04, 2007 3:32 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Changing Printer

Actually, I just reviewed the code.  It's not a report.  It's a bunch of
calls to an object.  Bartender (cute, huh) is the name of the program and I
call it from inside the form.

Code snip:

        Set btFormat = btApp.Formats.Open(Me.fldFABLabelFile, False, "")

        btFormat.SetNamedSubStringValue "Part No. (P)", Me.fldFABPartNumber
        btFormat.SetNamedSubStringValue "Quantity",
Me.fldContainerTotalPieces
        btFormat.SetNamedSubStringValue "OrderNumber", Me.cboJobs.Column(1)
        btFormat.SetNamedSubStringValue "ContainerNumber",
Me.fldContainerContainer
        btFormat.SetNamedSubStringValue "Serial", Me.fldContainerID
        btFormat.SetNamedSubStringValue "PO #",
Nz(Me.fldJobsEndCustomerPONumber)
        btFormat.SetNamedSubStringValue "LOT #", strVendorLot
        btFormat.SetNamedSubStringValue "Quantity Identifier", "Q"
        btFormat.SetNamedSubStringValue "R#",
Nz(Me.fldFABEngineeringChangeNumber)
        btFormat.SetNamedSubStringValue "EngineeringChangeNumber",
Nz(Me.fldFABEngineeringChangeNumber)
       
        btFormat.PrintOut False, False

So I need to change the default printer and then change it back again.  I
used to have some code somewher to do this but can't find it.

Rocky





 	
	

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William Hindman
Sent: Wednesday, April 04, 2007 2:48 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Changing Printer

...I use the "Select specific printer" option in the report set-up ...that
report always uses the selected printer and the rest use the default ...if
the bar-code printer is not available for some reason, the user will get a
pop-up dialog asking if they want to select another printer.

William Hindman

----- Original Message -----
From: "Rocky Smolin at Beach Access Software" <rockysmolin at bchacc.com>
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Sent: Wednesday, April 04, 2007 4:27 PM
Subject: [AccessD] Changing Printer


> Dear List:
>
> I have a client who installed a bar code printer.  If he makes it the 
> default printer that screws up all of this print previews on other 
> reports.
>
> So I'd like to change the default printer from inside the form that 
> prints the bar code labels and change it back to the default when done.
>
> Does anyone know of or have a code snip that does this?
>
> MTIA,
>
> Rocky
>
>
> Rocky Smolin
>
> Beach Access Software
>
> 858-259-4334
>
> www.e-z-mrp.com
>
>
>
> www.bchacc.com
>
>
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 



-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.25/745 - Release Date: 4/3/2007
12:48 PM
 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.25/744 - Release Date: 4/3/2007
5:32 AM
 




More information about the AccessD mailing list