Report Question

  • Thread starter Thread starter HearSay
  • Start date Start date
H

HearSay

I am not sure how to proceed with a report I am creating.

The form that I am using to gather the criteria for the report has two
listboxes (with multiple selections allowed) and two text boxes.

Can I create the query on the fly within the form? Could someone point me
in the right direction?
 
Download the example from this article:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

It illustrates how to build the filter string, and the Trouble-shooting and
Extending section gives an example of using that string as the
WhereCondition for OpenReport.
 
OK. Another question

strWhere = "[UserName] = '" & List13 & "'"
DoCmd.OpenReport "rptTasksByUser", acViewPreview, strWhere

I am using this to generate the report, however, it is not filtering, it is
selecting all my users. What am I doing wrong?
 
I believe that you are missing a comma. Note the two commas between
acViewPreview and strWhere

DoCmd.OpenReport "rptTasksByUser", acViewPreview,, strWhere


HearSay said:
OK. Another question

strWhere = "[UserName] = '" & List13 & "'"
DoCmd.OpenReport "rptTasksByUser", acViewPreview, strWhere

I am using this to generate the report, however, it is not filtering, it
is selecting all my users. What am I doing wrong?




Allen Browne said:
Download the example from this article:
Search form - Handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

It illustrates how to build the filter string, and the Trouble-shooting
and Extending section gives an example of using that string as the
WhereCondition for OpenReport.
 
Back
Top