[AccessD] Landscape Form Printing

Charlotte Foust cfoust at infostatsystems.com
Tue Oct 21 16:46:17 CDT 2003


Just a couple of observations.  You dim rpt as printer but you never
populate the object variable, so I'm not surprised by the error you're
getting.  It's absolutely factual - you haven't set the rpt as any
object, you just declared it.  Duplexing printers generally do not allow
a 1/2" bottom margin because they use a wider margin in order to grab
the paper.  You appear to be setting the orientation to portrait, not
landscape and the margin affected by duplexing is at the bottom of the
portrait page (right margin in landscape).

Charlotte Foust

-----Original Message-----
From: Dale Kalsow [mailto:dkalsow at yahoo.com] 
Sent: Tuesday, October 21, 2003 12:54 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] Landscape Form Printing


Good Afternoon,
 
I have the following code in Access XP, behind a button.  I am trying to
print the screen to the default printer in landscape.
 
Dim rpt As Printer
    
    Application.Printer = Application.Printers(0)
    
    With rpt
        .BottomMargin = 720
        .Copies = 1
        .Duplex = acPRDPVertical 'Double sided
        .PaperBin = acPRBNLargeCapacity
        .Orientation = acPRORPortrait
    End With
    DoCmd.PrintOut acPrintAll, 1, 1, acHigh, 1, True
    Set Application.Printer = Nothing
 
I get the error "Object with Block Variable not set " on the
.BottomMargin line.
 
Does any one know how to fix this?
 
Thanks in advance!
 
Dale


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list