Opening a report from a form

A

Angel b1

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

Marshall Barton

Angel said:
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"


AFAIK, the Filter argument is an archaic remnent that no
longer serves a useful purpose. The WhereCondition argument
is the preferred way to filter data when opening a
form/report.

Not clear what that statement is trying to do, but I think
this is what you're asking for:

strCriteria = "memberID=" & txtmemberID
DoCmd.OpenReport "rpt_SelectMemberRequest", acViewPreview, ,
strCriteria
 

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