Re: Passing date range Parameter to subreport

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Well that does work but what if I want to print from a different form or I
want to print all reports for the first qtr. that would mean they get three
reports, one for each month?
Isn't there a more dynamic way of passing parameters? From my understanding
the subreports open before the main report so even if I place those two
field on the report it couldn't pass them.

Thanks for you help.

"Ken Snell (MVP)" <kthsneisllis9@xxxxxxxxxxxxxxxxxx> wrote in message
news:%23I$kenIUGHA.5108@xxxxxxxxxxxxxxxxxxxxxxx
And keep the form open (can be hidden) while the report is being opened
and viewed/printed.

--

Ken Snell
<MS ACCESS MVP>

"Duane Hookom" <duanehookom@xxxxxxxxxxxxxxxxx> wrote in message
news:eXPhQRHUGHA.2244@xxxxxxxxxxxxxxxxxxxxxxx
All you should have to do is allow users to enter the start and end dates
on the form. Then set the subreport record source query to use the
controls on the form like:

Between Forms!frmX!txtStart and Forms!frmX!txtEnd

--
Duane Hookom
MS Access MVP
--

"John Buehler" <john.buehler@xxxxxxxxx> wrote in message
news:%23$cNMCGUGHA.5148@xxxxxxxxxxxxxxxxxxxxxxx
This one would seem easy but I have not figured it out for the past 3
days.

Like everyone else I have a main report with subreports. They are all
linked to the main report by a common index but one subreport I want to
find information pertaining to the corresponding month of the report not
all records. All records would be easy.

The user does data entry in a form, clicks a button, report prints
everyone is happy but now we want more info which involves a new
subreport.

Okay lets get to meat of the subject:
In a form the user type a plethora of items which includes a date in one
of the fields, could be any date. I take that date run it up to a
global procedure in the module which gives me the first and last day of
the month and year in two separate variables.

I want that date range to be used in one of the subreports to give me
everything associated with this particular subjects records for the
month that corresponds with the original date entered.

I've tried to put unbound text boxes on the main report as well as the
subreport so the subreport's query can use those for parameters. I've
tried Select Where clauses but found that they can only take one date
not a range. I tried concatenating variables and text into one and
passing that. I felt like I got really close when I manually entered
the parameters and it worked but like everyone else on this newsgroup
I'm missing it.

I don't want the user who is printing these reports to type the date
ranges a hundred times for all the reports, I've already got it done for
them.








.


Quantcast