Report Filter

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I want to generate a report from a form that is based on
a master form (form header)and three subforms (form
detail). I want the report to filter the results by the
value displayed in the control "JobNumber" on the current
open form.

Easy?
 
Try this method: -

1. Create a select Query (JobNumberFilter) that lists all
of the fields that you want to appear on the Report.
2. Set the criteria for the "JobNumber" field as: -
Like Forms![MasterForm]![SubFormID]!Form![JobNumber] (my
syntax may be a bit wrong!!). Save and close the Query.
3. Set the Reports "Data Source" to the new Query.
4. Open The Form, do the filters then open the Report.

HTH


Tony C
 
Jim,

You could define for the report

Private Sub Report_Open(Cancel As Integer)
me.filter = "JobNumber=" & JobNumber
End Sub

that is assuming the name of the field is JobNumber also.
 
Back
Top