Print Report with 2 extra lined pages

access2010

Registered User.
Local time
Yesterday, 16:23
Joined
Dec 26, 2009
Messages
1,021
Could we please receive a suggestion on how to print reports with 2 extra pages?

How can we print this report when investigate is Yes and then AFTER the report is printed, "Yes" in the table will be changed to No?

Thank you for your suggestions.
Marlyne
 

Attachments

  • Template_Analytic_R_Investigate=Yes.mdb
    552 KB · Views: 80

ebs17

Well-known member
Local time
Today, 01:23
Joined
Feb 7, 2020
Messages
1,946
The 2 extra lined pages could be included as a subreport in the report.
 

GaP42

Active member
Local time
Today, 09:23
Joined
Apr 27, 2020
Messages
338
Your form button to print preview the report, does not specify a record from the investments table:
stDocName = "Template_Analytic_R_Investigate_Yes"
DoCmd.OpenReport stDocName, acPreview
- at least in the sample db you provided.

If it did then you could write a simple SQL update to the record in the Investments table for which the report was printed that could update Yes to No in the investigate column immediately after print preview command. Construct your SQL statement then use DoCmd.runSQL - works for action queries.

- if the report is all the Yes records then a similar solution without needing the record id.
 

GaP42

Active member
Local time
Today, 09:23
Joined
Apr 27, 2020
Messages
338
As your report prints all records, assuming that is what you want then the code behind the button would be:
Code:
Private Sub Print_Report_Than_Clear_Click()
Dim strSQL As String

stDocName = "Template_Analytic_R_Investigate_Yes"
DoCmd.OpenReport stDocName, acPreview
DoCmd.Maximize

strSQL = "UPDATE Investments01_tbl SET Investments01_tbl.Investigate = No " & _
            "WHERE (((Investments01_tbl.Investigate)=Yes));"

DoCmd.RunSQL strSQL

End Sub

Follow thru on the extra pages requirement as ebs17 suggested.
PS the code module should have statements:
Option Database Compare
Option Explicit

declared as the first two lines - assume this is because it was a sample only.
 

Users who are viewing this thread

Top Bottom