P said:
Hi,
Access 2002. I am trying to use the PrintOut function to print the current
record of the current open form in landscape format to the default Windows
printer. Any suggestion on how to set the printout to landscape mode? Thank
you. P
PrintOut won't do what you want.
1) A form is for data entry and manipulation, not for printing.
2) Make a report that shows the fields you would like to print.
3) In design view, click:
File + Page SetUp + Page.
Set the report to Landscape.
Save the report.
3) Add a command button to the form.
4) Code the command button click event:
DoCmd.OpenReport "ReportName", acPreview, , "[RecordID] = " &
[RecordID]
The above code assumes your record has a unique prime key field of
Number datatype.
See Access help for how to code different datatypes:
Where clause + Restrict data to a subset of records
The report will display just the record shown on your form.
Change acViewPreview to acViewNormal to print without preview.
5) If for some reason you absolutely must print the record data with the
form as background, on the database window, right-click on the form,
and select 'Save as Report'.
6) Set it to Landscape, as above.
7) Use the same command button code as above to print the report (which
will look like your form).