Report from table into query

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

Golfinray

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.
 
K

Klatuu

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
 

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