Hello,
I have created a main report for my db which includes a sub report.
On a form, I have a cmdbutton which converts the report into a pdf file and attaches it to the email.
Depending from the value selected in a combobox, the report may or not include the sub report.
If selection in combo is "A" then the report includes the Subreport. If selection is B, then it does not.
This is the code I have placed in the OnFormat event of report's Detail:
The code behind the cmd button which converts the report is the following:
My problem is that when I select "A" meaning that I want only to include the main report, I still get a blank second page, although the design of them main report fits one page.
Is there a way I can avoid to include in the pdf the second page?
Thank you for your help
I have created a main report for my db which includes a sub report.
On a form, I have a cmdbutton which converts the report into a pdf file and attaches it to the email.
Depending from the value selected in a combobox, the report may or not include the sub report.
If selection in combo is "A" then the report includes the Subreport. If selection is B, then it does not.
This is the code I have placed in the OnFormat event of report's Detail:
Code:
If Me.myCbo = "A" Then
Me.rptTotal.Visible = True
Me.rptSubPartial.Visible = False
End If
If Me.mycbo = "B" Then
Me.rptTotal.Visible = False
Me.rptSubPartial.Visible = True
End If
The code behind the cmd button which converts the report is the following:
Code:
DoCmd.SendObject acReport, "RptTotal", "PDFFormat(*.pdf)", "", "", "", "Case:" & " " & ME.FNAME & " " & ME.LNAME & " - " & ME.FILENO, "Thank you", True, ""
My problem is that when I select "A" meaning that I want only to include the main report, I still get a blank second page, although the design of them main report fits one page.
Is there a way I can avoid to include in the pdf the second page?
Thank you for your help