Filtered Report

N

Nick Stefanov

Trying to filter and open a report based on a form with a
combo box.
Setup a query like this:

SELECT Projects.Job_Name, Projects.Type, Categories.Category
FROM Categories INNER JOIN Projects ON
Categories.ID=Projects.Category
WHERE Categories.Category=Forms!Report!Category;

where the name of the Combo box is Category (my 2 tables
are projects and categories). Then just added a button to
launch the report. The report opens without the filter
being applied. Any info is appreciated. Thanks
 
J

Jeff Boyce

Nick

If your two forms are named [Projects] and [Categories], why are you using

Forms!Report!Category

That implies you also have a form named [Report].
 
G

Guest

-----Original Message-----
Nick

If your two forms are named [Projects] and [Categories], why are you using

Forms!Report!Category

That implies you also have a form named [Report].

--
Good luck

Jeff Boyce
<Access MVP>
.
The form which has the combo list that I want to use as
the filter is named Report....
 
J

Jeff Boyce

You may be running into difficulties because you are using a reserved word
"Report".
 
N

Nick Stefanov

-----Original Message-----
You may be running into difficulties because you are using a reserved word
"Report".

--
Good luck

Jeff Boyce
<Access MVP>

.
Thanks for the help. I changed all the names but got the
same result. When I try to just open the report just by
doubple clicking on it (istead of using the command button
on the filter form) it does ask for the parameter value
(Forms!MyFilterForm!MyComboFilterBox) and if I type it in
it works fine. However, if I make the selection on the the
combo box and then click my Preview Button button the
report opens up blank. Somehow the filter is not being
passed to the report? Surely this is a common thing. Any
examples of I how to do it? Thanks ahead of time.

Nick
 
J

Jeff Boyce

Nick

You are using a combo box for your "filter" value. Is there a chance that
your combo box holds an ID# but displays a more meaningful value, while your
report's query is looking for that value?
 
Top