I have an agreement template in a MS access report. The report's fields are populated by the form's records. my goal is to automate the report to filter to the agreement # to what ever the current agreement # on the form is. i do not want to have to enter the agreement # every time i click on the cmd function to preview the report. below is the code i have, can someone please edit my code to what it should be?
thanks!
Code:
Private Sub Command99_Click()
On Error GoTo Err_Command99_Click
'Defines Variables:
Dim stReportName As String
Dim stFilter As String
'stFilter = [Agreement#].Value
stReportName = "rptLicenseAgreement"
DoCmd.OpenReport stReportName, acPreview, , stFilter, acDialog
Exit_Command99_Click:
Exit Sub
Err_Command99_Click:
MsgBox Err.Description
Resume Exit_Command99_Click
End Sub
Comment