Where Statement to Open Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On a different post, I was given a useful suggestion on using a Where
statement I store in a text box (see form and field name below) to open a
form. I placed the following code on my form:

Me.Filter = strWhere
Me.FilterOn = True
strWhere = Forms![frmM_LeadCriteria2A]![Where]

This works great for the form, but I can't seem to get it to work on the
report. I placed the same code on the On Open event of the report, and it
doesn't seem to recognize the Where statement.

Thanks,
Bernie
 
I would use the strWhere in the OpenReport method.
DoCmd.OpenReport "rptYourRpt", acPreview, , strWhere
 
Back
Top