How to print a Form
May 2 2006, 10:07 PM
Utterly Crispy UA Forum Administrator
Joined: 29-September 01
I have seen so many ask how do I print a form?
Normally you don't print forms you use reports but when the need arises here is how you do it.
The Form must be open it can be hidden but it must be open.
The code you use is as follows:
DoCmd.SelectObject acForm, "Your Forms Name Goes Here"
DoCmd.PrintOut acPages, 1, 1
This can be called from the click event of a button on another form or from inside a Function.
In Access2002, many more options are available.
You can choose print quality, landscape/portrate, which pages etc
I think paper size, print margins can be changed as well, whereas in Access2000 they can not.
Printer.Orientation = acPRORPortrait
DoCmd.PrintOut PrintQuality:=MyPrintQualityG, _
Printrange:=MyPrintRangeG, PageFrom:=MyPageFromG, _
The printer object was new in A2002,
check the help file for more info.
Hope this helps someone who really needs to print a Form.
Edited by: GlenKruger on Thu Jun 29 19:21:23 EDT 2006.
|Search Top Lo-Fi||30th March 2017 - 07:26 PM|