Strange thing with printing a form

  • Thread starter Thread starter DIOS
  • Start date Start date
D

DIOS

Im developing in Access2000 and I have a form with 20 textboxes
and 5 command buttons.

First attempt is to print the form in portrait mode and make all the
command buttons invisble. I have used Me.WindowWidh and .InnerWidth
to resize the forms width but it doesnt seem to work as it seems the
entire form is being printed. I thought that by making the controls invisble
and making their .Left property as 0 i would be bale to shorten the width
and that way the entire form would print on one sheet of paper.

Second attempt was to programatically set the priner to print in landscape
but it seems that Access2000 does not support that feature. Does anyone
have some code that would let me do this?

Thanx
AGP
 
Save your self a bunch of trouble, and just completely dump the idea of
using a form to print. While a car has reverse, it is not the way your
normally drive a car!

The same goes for printing. Forms are for data input. If you are trying
print, and do things like set the orientation of the printer, then simply
use a report, as it will do that for you.

So, built a report with those text boxes. Heck, you can cut and paste form
the form if you wish.

Further, the report has nice luxuries like page numbers, page headings,
report headings. The choices you have are numerous, and should handle any
kind of desire you have.

Also, when you try printing a form, it will print all records. With a
report, you have a lot more flexibility. To print JUST the current record,
you can use the following code behind a button:

me.refresh
docmd.OpenReport "YourReport",acViewPreview,,"id = " & me.id

Is there any reason left why you want to use a report? You have already
spent more time playing around with the form then what creating a fine
solution using a report would have done for you!

Your answer to all your troubles is to simply use a report.....
 
yeah i was thinking about that but i was hell bent on finding a solution
for my own sake. Anyway ill give that report a shot.

By the way the printing does not print all records. I do
DoCmd.RunCommand acCmdSelectRecord
DoCmd.PrintOut acSelection

and only the current record is printed.

So with the report...how do i set the orientation and then print out the
report? Or at least where do i find documentation on it?

AGP

Thanx
 
So with the report...how do i set the orientation and then print out the
report? Or at least where do i find documentation on it?

While in report design mode, just go file->page setup->

Just click on the page tab, and select landscape. When you save the report,
the orientation will be saved with it. So, really, this takes no code!

The same goes for all the margin settings etc. They are saved with the
report.

If you are using a2000, then a daily bug/question in this newsgroup is why
does ms-access sometimes forget the printer settings? The solution is turn
off auto name correct, or even better is to install the bug fixes to office
(ie: install the sr updates).

Check out:

ACC2000: Lost Printer Settings When Name AutoCorrect Is Enabled

http://support.microsoft.com/default.aspx?scid=kb;en-us;240826
 
Back
Top