Open Report from Form

halem2

Registered User.
Local time
Today, 17:01
Joined
Nov 8, 2006
Messages
180
Using Access 2000.

Is there an easy way to open a report from a form filtering the report by a specific field?

In other words, I have a form with a button that opens a report but it shows ALL items. I need to filter it by, let's say a field named "Location"

thank you
 
create a query report and filter it by the field you require.
 
If the form contains a value that would filter the query that the report is based on, it is simple.
In the query that creates the dataset for the report, in the column that has the value from the report that you want to filter on insert this syntax into the criteria of that column.
[Forms]![YOURFORMNAME]![THEFIELDONTHEFORMWITHTHEVALUE]
Run the report from the form
DoCmd.OpenReport "YOURREPORTNAME"
And you will have a filted report.
Simple 'eh

Hope this helps : )
 
thank you for both answers. I have already tried that and it fails. I also tried doing it using a macro and using the Where condition and it fails. I have done this before successfully but I'm stummped now.
 
thank you for both answers. I have already tried that and it fails. I also tried doing it using a macro and using the Where condition and it fails. I have done this before successfully but I'm stummped now.
 
tried it once more and it works as you said. Thank you for your help.:D
 

Users who are viewing this thread

Back
Top Bottom