I am having trouble coding a openreport code. Basically I have a button in my form to open a report, and the criteria for the report should be based on whatever entry the user is on in the form. I am using the below code but it is not applying the criteria. Any idea what I'm doing wrong? The report's record source is qryComplaints and 'complaintnumber' is a number field.
Code:Private Sub btnOpenReport_Click() DoCmd.OpenReport "rptFormReport", acViewReport, [ComplaintNumber] = Forms![frmComplaints]![ComplaintNumber], acDialog End Sub