Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 417
  • Last Modified:

Setup of Page before Printing

Hi all,

I need to be able to setup my page layout before I print a report... I need to specify somehow:

PageTop = 0.1"                       ' just as an example
PageBottom = 0.1"
PageLeft = .7"
PageRight = .7"

I need it to print Portrait with the default printer....

But I must do this with code, on my print command... can anybody help me ? This is in ACCESS VBA by the way..

Thank You,

Robert Mezei
0
originalrobby
Asked:
originalrobby
  • 5
  • 3
1 Solution
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Which version of Access? For AXP, there is a printer object, which makes doing this a whole lot easier.  For versions before that, I would suggest purchasing On The Fly Printing by ATTAC Consulting (http://ourworld.compuserve.com/homepages/attac-cg/) or purchasing a book, which includes sample code.

  The reason I say this is that the code is quite lengthy and it would take you a considerable amount of time to come up with it.  OTF printing runs about $100 or so, a book is about $50.  This is one of those cases where you'd spend a lot more trying to come up with it on your own then simply buying it.

Jim.
0
 
originalrobbyAuthor Commented:
Umm, I have code actually that does this and it is not lengthy at all, only it is in VB.NET.

It is ACCESS 97, VBA 5.0 I believe...

I do indeed need to create a printer object and specify the top, bottom, left and right margins, and somwhow like this:

With Printer                 'how do i define it ?
' Initialize Printer Object
Printer.Orientation = vbPRORPortrait ' ? again not sure
Printer.PrintQuality = 300
Printer.Print ""
               
PageBottom = (.Height + .ScaleHeight) / 2 - 720 ' example


If anyone can help me, please do so, I'd greatly appreciate it, it's going in an database application of 2000+ records
0
 
originalrobbyAuthor Commented:
Umm, I have code actually that does this and it is not lengthy at all, only it is in VB.NET.

It is ACCESS 97, VBA 5.0 I believe...

I do indeed need to create a printer object and specify the top, bottom, left and right margins, and somwhow like this:

With Printer                 'how do i define it ?
' Initialize Printer Object
Printer.Orientation = vbPRORPortrait ' ? again not sure
Printer.PrintQuality = 300
Printer.Print ""
               
PageBottom = (.Height + .ScaleHeight) / 2 - 720 ' example


If anyone can help me, please do so, I'd greatly appreciate it, it's going in an database application of 2000+ records
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
originalrobbyAuthor Commented:
Umm, I have code actually that does this and it is not lengthy at all, only it is in VB.NET.

It is ACCESS 97, VBA 5.0 I believe...

I do indeed need to create a printer object and specify the top, bottom, left and right margins, and somwhow like this:

With Printer                 'how do i define it ?
' Initialize Printer Object
Printer.Orientation = vbPRORPortrait ' ? again not sure
Printer.PrintQuality = 300
Printer.Print ""
               
PageBottom = (.Height + .ScaleHeight) / 2 - 720 ' example


If anyone can help me, please do so, I'd greatly appreciate it, it's going in an database application of 2000+ records
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Originalrobby,

  Please don't hit the refresh button, which on EE will cause duplicate posts.  Unlike VB, there is no printer object in A2000 and prior.  The only way to deal with printers is via the PrtDevMode and PrtMip structures.  Handling those can become quite complex.

  It's simply faster/cheaper to buy this code in one form or another.

Jim.
0
 
originalrobbyAuthor Commented:
Umm, I have code actually that does this and it is not lengthy at all, only it is in VB.NET.

It is ACCESS 97, VBA 5.0 I believe...

I do indeed need to create a printer object and specify the top, bottom, left and right margins, and somwhow like this:

With Printer                 'how do i define it ?
' Initialize Printer Object
Printer.Orientation = vbPRORPortrait ' ? again not sure
Printer.PrintQuality = 300
Printer.Print ""
               
PageBottom = (.Height + .ScaleHeight) / 2 - 720 ' example


If anyone can help me, please do so, I'd greatly appreciate it, it's going in an database application of 2000+ records
0
 
originalrobbyAuthor Commented:
NOOOOOOOOOO!!!!!!!!!!

Sorry guys, I didnt realize it was reposting it!!!! CR*P!
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<NOOOOOOOOOO!!!!!!!!!!

Sorry guys, I didnt realize it was reposting it!!!! CR*P!
>>

 quite alright...*everyone* does it sooner or later<g>

Jim.
0
 
1WilliamCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept question, points to JDettman
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

1William
EE Cleanup Volunteer
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now