Opening a report from a form

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

Guest

I would like to open a report and restrict its records to those
Specified by the value in a text box on the form. The report is based on
A query. The criteria in the query is blank. I don’t what to be prompted by
The where condition in my code. Does anyone know how to do that?

strFilter = "qry_selectMemberRequest"
DoCmd.OpenReport "rpt_SelectMemberRequest", acViewPreview, strFilter,
"tbl_memberOverrides.memberID=txtmemberID"
 
Why don't you just reference the text box on your form in the criteria of
your query?
e.g. (tblData.ImportDate)=[Forms]![frmMain]![txtImportDate])

Use the expression builder and navigate to the form control you wish to use
to build the syntax.

Paul
 
Back
Top