I have a button that prints a report based on the data of a form. This works great, BUT...
I want to label the report depending on the contents of the form... for example if the StartDate and EndDate of the report are based on 2 fields on a form, how can I show these values in the header of the report?
This is the simple call I have so far:
'account summary report
If Check43.Value = -1 Then
stDocName = "AccountSummary"
stLinkCriteria = "[LDateOut] >= #" & StartDate & "# AND [LDateOut] <= #" & EndDate & "#"
If Frame8.Value = 1 Then 'send to printer
DoCmd.OpenReport stDocName, acViewNormal, , stLinkCriteria
ElseIf Frame8.Value = 2 Then 'send to screen
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
End If
End If
***This works great for data output, but how do I send StartDate & EndDate to the report if it is printing as acViewNormal ???
I want to label the report depending on the contents of the form... for example if the StartDate and EndDate of the report are based on 2 fields on a form, how can I show these values in the header of the report?
This is the simple call I have so far:
'account summary report
If Check43.Value = -1 Then
stDocName = "AccountSummary"
stLinkCriteria = "[LDateOut] >= #" & StartDate & "# AND [LDateOut] <= #" & EndDate & "#"
If Frame8.Value = 1 Then 'send to printer
DoCmd.OpenReport stDocName, acViewNormal, , stLinkCriteria
ElseIf Frame8.Value = 2 Then 'send to screen
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
End If
End If
***This works great for data output, but how do I send StartDate & EndDate to the report if it is printing as acViewNormal ???