printing subforms

reel knotty

Registered User.
Local time
Today, 04:03
Joined
Jun 5, 2002
Messages
71
Ok guys Heres the skinny...
I am working on a form with 2 subforms. The form is to be used as a confirmation print out. Problem is when I try to print the form it only prints (or displays in preview) the parent form and no information of the child forms.

As always any input is greatly appreciated!

Nate
 
Forms are not optimized for printing. And due to the nature of subforms, Access cannot print them.

Create a report with subreports. In your print button, use the OpenReport Method. Use the where argument to supply the key of the main report record.
 
Nate

The printing of forms is troublesome business.

Your best bet is to make a Report.
Have your print button open the Report and have the Report's control source be tied to a query that looks up the information on your form.

HTH
Tom
 
Thanks Guys! I ended up creating a report from the form. I know it is not the normal way but some of the info on the subforms I wanted to print is not related after it is entered.


Thanks again for the tip!!
 
This Works

I use a command button on the subform (printer icon).. set it's properties to visible 'screen only'. now paste this code into the buttons 'on click'



Dim stDocName As String
Dim MyForm As Form

stDocName = "subformname"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False



Works for me!
 
Re: This Works

I use a command button on the subform (printer icon).. set it's properties to visible 'screen only'. now paste this code into the buttons 'on click'



Dim stDocName As String
Dim MyForm As Form

stDocName = "subformname"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False



Works for me!



I know this thread is really old but what would you need to change if you wanted to print it in landscape view?
 
Open the report in design view.
Click on the "Page Setup"
In "Page Layout" select "Landscape"
 
I'd create a report to do what you need as they are actually for printing, but if that isn't an option, check out THIS THREAD and see if it answers your question.
 

Users who are viewing this thread

Back
Top Bottom