Report from table into query

  • Thread starter Thread starter David
  • Start date Start date
D

David

Hi,

I made a report from a table with some data.
But now I need the same report but with some filtering of 2 fields.
I can make a query from the table with the filtering, but then can I use the
same report with the query or I have to do it all again?

Thanks.
 
You can change the recordsource of the form from the table to the query. Just
make sure the query has the same fileds as the table.
 
The best way to do this is with the Where argument of the OpenReport method.
You just create a Where clause just like in a query, but without the word
Where"

strWhere = "[SomeField] = """ & Me.txtSomeControl & """ AND
[AnotherField] = " & Me.txtAnotherControl

Docmd.OpenReport "MyReport", , , strWhere
 
Back
Top