Printing a subreport within other forms (1 Viewer)

Local time
Today, 04:53
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

  • TC6-Temp2.zip
    958.7 KB · Views: 86

theDBguy

I’m here to help
Staff member
Local time
Today, 01:53
Joined
Oct 29, 2018
Messages
21,357
Hi. You should be able to simply use the OperReport method using the same filter in the WhereCondition argument.
 

HiTechCoach

Well-known member
Local time
Today, 03:53
Joined
Mar 6, 2006
Messages
4,357
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.
 

mike60smart

Registered User.
Local time
Today, 08:53
Joined
Aug 6, 2017
Messages
1,899
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

  • TC6-Temp2.zip
    935.4 KB · Views: 104

Users who are viewing this thread

Top Bottom