Print subform

D

Daniel

Good morning,

I would like to know what the code, behind a click event of a button, would
be to print out the entire contents of a subform in a landscape layout using
as many page as necessary. Basically, I want to do a fit to size of
landscape and take up as many page as necessary to list all of the records
contained in the subform.

I was hoping this could be done without having to create a report?!

Thanking you in advance for the help,

Daniel
 
A

Albert D. Kallal

I was hoping this could be done without having to create a report?!

Built a report. Forms are really bad when it comes to printing. With a
report, you can set the landscape, control the fonts and layouts, have page
numbers, have page heading. You have a zillion more things you can control
correctly. And, the code is nicer to printer the sub-form records also.

The code to launch the report for just the current records (assuming a
parent to child relationship).

docmd.OpenReport "MyReport",acViewPreview,,"subtableLinkid = " & me.ID

of course, you need to replace subtableLinkId with the name of the field in
the sub-form used to link back to the parent table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top