View Single Post
  #1  
Old April 5th, 2006, 07:18 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Access Form values to Report to Query

OK guys, I'm stumped and need some help.

I am writing some reports for a client.

I started by writing a query which is used for all the reports. The
query prompts for start and end date and a value to filter by from a
table or 'ALL' returns an unfiltered record set.

The report runs just fine and prompts for the values.

The client now wants to select the start and end dates from a calendar
function rather than enter them directly and select the filter from a
drop down box so I have built an unbound form with two calendar
controls, the filter with drop down and a tick box to say don't filter
which sets enabled = false on the filter I have also put a hidden text
field on the form which takes the filter value or 'ALL' if the tickbox
is true.

I can get the query to correctly filter by the parameters on the form
by changing the selection criteria to specifically look at the form but
I may want to use the query again with a different form.

What I really want to do is pass the form values through to the report
and have the filter function on the report override the query
parameters but I cant make it work.

Any ideas what i'm doing wrong and what is the best alternative. I'm
thinking, maybe take the filter criteria out of the main query and
build another query specifically for the report that takes the values
from the form but this is a cop out as far as I am concerned.

We are using Access 2003 on XP Pro SP2

Thanks guys


Obiron