I have a feeling this question may have surfaced on this forum before.
What I am in the process of doing is having a button feature on a form. Once clicked, it will print the corresponding report for whatever record you were viewing in Form View.
I have taken a stab at some VBA code (I googled around, and copied some code) and I get a message like so:
"Run-time error '2497':
The action or method require a Report Name argument."
Anyone know what this could be?
Here is the code:
Private Sub Print_Report_Click()
Dim Master_Report As String
Dim strCriteria As String
strCriteria = "ID = " & Me.ID
rptName = "Master_Report"
DoCmd.OpenReport Master_Report, acViewPreview, , strCriteria
End Sub
--------
Where Master_Report is the name of the report, and ID refers to the ID of the record I am currently viewing in Form View.