Re: Default use Specific Printer and Label Size
- From: "ARC" <PCESoft@xxxxxxxxxxxxxxx>
- Date: Fri, 2 Nov 2007 16:53:25 -0500
Thanks, however this is a .mde file, so the design view wouldn't be available. :(
"Stuart McCall" <smccall@xxxxxxxxxxxxxxx> wrote in message news:fgfp1q$4m1$1$8302bc10@xxxxxxxxxxxxxxxxxxx
"ARC" <PCESoft@xxxxxxxxxxxxxxx> wrote in message news:UzIWi.3963$Nz7.2323@xxxxxxxxxxxxxxxxxxxxxxxWhere are you placing the function you wrote?
I found a strange thing with trying to set the paper size using the application.printer object. Using the code I'll paste below, as long as you Preview the report, it will set the paper size. However, if you just go straight to printing (using the docmd.openreport.... acNormal), the code below doesn't work, even though I have the code in the On_open of the report, so it is firing. Any ideas on that? If using acNormal causes any application.printer commands to be ignored, then I need to somehow find a different solution, as many of my customers like to print, rather than preview first. Thanks!
Dim rpt As Access.Report
Set rpt = Reports(Forms!frmOpt.Form!RunName.Caption)
'Set the default printer's orientation to landscape
'rpt.Printer.Orientation = acPRORLandscape
'Set the default printer's paper size to legal
If TempVars!PaperSize <> 1 Then
rpt.Printer.PaperSize = TempVars!PaperSize
End If
<raf_technologies@xxxxxxxxx> wrote in message news:1193950736.548032.296910@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxOn Nov 1, 2:11 pm, raf_technolog...@xxxxxxxxx wrote:On Oct 17, 5:10 am, Doug <anonym...@xxxxxxxxxx> wrote:
> Ian,
> We've been having the identical problem for the past year and have > been
> unable to find a solution.
> The problem started when we upgraded Access on all of the > workstations.
> We only put the full versions on the computers where design work was
> being done since the company doesn't have that many licenses. We may > try
> loading full versions on the computers that are used for printing > labels
> to see if that helps. We have a feeling, though, that whenever we > update
> the .mdb, we might still need to open and save the label report in
> design mode on each computer.
> If we make any progress I will post it here. Please do the same if > you
> find anything.
> Doug
> *** Sent via Developersdexhttp://www.developersdex.com***
Hello All,
Take a look at these articles...they should help you out.
The first will show how to change page settings and the second shows
you all the setting values
http://support.microsoft.com/?kbid=302416
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnar...
Happy Printing,
Rob F- Hide quoted text -
- Show quoted text -
Sorry guys, I missed the MDE part of that.
Here's a function I wrote that uses the Application.Printer object.
This seems to work great with the MDE I distribute to the desktop....
Best Regards, Rob F
Public Function PrintTags(ByVal vlngNumber, ByVal vintChangeFlag,
Optional ByRef rvarErrorMsg As Variant)
'This function prints a tag a specified number of times
Dim lngNumber As Long
Dim prt As Printer
Dim strDefault As String
Dim blnFound As Boolean
On Error GoTo ErrTrap
If vlngNumber = 0 Then Exit Function
strDefault = Application.Printer.DeviceName
blnFound = False
'print to the label printer
For Each prt In Printers
If InStr(1, prt.DeviceName, "label") Then
Application.Printer = prt
Application.Printer.PaperSize = acPRPSUser
If LabelType = "Big" Then
Application.Printer.ItemSizeHeight = 2150
Application.Printer.ItemSizeWidth = 4000
Else
Application.Printer.ItemSizeHeight = 1130
Application.Printer.ItemSizeWidth = 3500
End If
Application.Printer.BottomMargin = 0
Application.Printer.TopMargin = 0
Application.Printer.LeftMargin = 0
Application.Printer.RightMargin = 0
Application.Printer.Orientation = acPRORLandscape
blnFound = True
GoTo FoundPrinter
End If
Next prt
FoundPrinter:
If blnFound Then
If IsNull(vintChangeFlag) Then vintChangeFlag = 0
If vintChangeFlag < 2 Then
lngNumber = Nz(vlngNumber, 0)
Do While lngNumber > 0
If LabelType = "Big" Then
If GetLocation = "SHPS" Then
DoCmd.OpenReport
"rptLabelSeikoIndividualBig_SHPS"
Else
DoCmd.OpenReport "rptLabelSeikoIndividualBig"
End If
Else
DoCmd.OpenReport "rptLabelSeikoIndividual"
End If
lngNumber = lngNumber - 1
Loop
End If
Application.Printer = Nothing
Else
MsgBox "Label Printer Not Found", vbCritical + vbOKOnly,
"Can't Print"
End If
GoTo ExitFunction
ErrTrap:
gvarErrNum = Err.Number
gvarErrDesc = Err.Description
rvarErrorMsg = BuildError("PrintTags", "mdlGlobalFunctions",
CNames(conintUser), gvarErrNum, gvarErrDesc, rvarErrorMsg)
ExitFunction:
End Function
The only way I've found to do this successfully is to:
Application.Echo False
DoCmd.OpenReport RptName, acViewDesign
'Make your changes
DoCmd.Close acReport, RptName
DoCmd.PrintOut
Application.Echo True
(untested code, but enough to get the gist)
Ugly, huh?
.
- Follow-Ups:
- Re: Default use Specific Printer and Label Size
- From: Stuart McCall
- Re: Default use Specific Printer and Label Size
- References:
- Re: Default use Specific Printer and Label Size
- From: raf_technologies
- Re: Default use Specific Printer and Label Size
- From: raf_technologies
- Re: Default use Specific Printer and Label Size
- From: ARC
- Re: Default use Specific Printer and Label Size
- From: Stuart McCall
- Re: Default use Specific Printer and Label Size
- Prev by Date: What are macros in A2003?
- Next by Date: About Access 2003 ODBC and Jet 3.51
- Previous by thread: Re: Default use Specific Printer and Label Size
- Next by thread: Re: Default use Specific Printer and Label Size
- Index(es):
Relevant Pages
|
Loading