X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Closed TopicStart new topic
> How to print a Form    
post May 2 2006, 10:07 PM

Utterly Crispy UA Forum Administrator
Posts: 8,791
Joined: 29-September 01
From: Edmonton,Alberta,Canada

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.

For example:

Printer.Orientation = acPRORPortrait
DoCmd.PrintOut PrintQuality:=MyPrintQualityG, _
Printrange:=MyPrintRangeG, PageFrom:=MyPageFromG, _
PageTo:=MyPageToG, Copies:=MyCopiesG

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.
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    14th December 2018 - 04:31 PM