Opening a report from a form

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"
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top