Printing a subreport within other forms

Local time
Today, 13:35
Joined
Feb 2, 2020
Messages
54
Within the "Report Center" tab, the user should choose a filter to filter the report that is in place.
I would then like to be able to print out the resulting report.
I can't seem to accomplish this as the SubReport is part of a form on a tab control.

Would love some help with the VBA to accomplish printing the subreport that is in place and ultimately also saving as PDF with same scenario.

thank you
 

Attachments

Hi. You should be able to simply use the OperReport method using the same filter in the WhereCondition argument.
 
I agree with theDBguy that you need to create a report to print

In the command button on the form, open a report with the form's filter.

Code:
Private Sub cmdOpenReport_Click()

If Me.Filter = "" Then
     DoCmd.OpenReport "rptCustomers", acViewPreview
Else
     DoCmd.OpenReport "rptCustomers", acViewPreview, , Me.Filter
End If
End Sub

While it is possible to embed a report on a form as a subreport, I find it best to use a form in a subform control.
 
Hi Michael

In the attached I moved your Print Command Button and renamed it "Preview Report"

See if this now does what you need
 

Attachments

Users who are viewing this thread

Back
Top Bottom