How do subreports get criteria from form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've read many great posts but I'm having a problem telling my subreports
where to find the criteria that was entered into the unbound textboxes on my
form. The form stays open (as far as I can tell) but the subreports don't
get the data from the underlying parameter query. I have seven subreports
gathering data from the query.

I have given them each the query name as data source. Should I be giving
them the form instead?

Thank you for any advice!
 
Kathy said:
I've read many great posts but I'm having a problem telling my subreports
where to find the criteria that was entered into the unbound textboxes on my
form. The form stays open (as far as I can tell) but the subreports don't
get the data from the underlying parameter query. I have seven subreports
gathering data from the query.

I have given them each the query name as data source. Should I be giving
them the form instead?


The queries are what needs to refer to the form control's.
The criteria would be along these lines:

Forms!yourform.sometextbox
 
Thank you, Marsh!

I have a query with the following criteria [Forms]![EvalQForm]![semester]
and [Forms]![EvalQForm]![coursenumber]. The query is called EvalQComm and in
the Record Source for each subreport, I've put the query name.

Opening the report calls the form but now (suddenly) no data appears. At
one point, I had each subreport looking directly for a matching data field in
the query and then I would get the repeating parameter window popping up. I
took that out and now I get no results from the query at all. It's all
getting very weird. :)

Thank you for your help!
 
PS: I forgot to mention this - opening the main report starts the form and I
get a report that shows no data. Opening a subreport gives me the parameter
query window and I get the correct data. Somehow, my form isn't actually
passing criteria (or so it seems to me).
 
Kathy said:
PS: I forgot to mention this - opening the main report starts the form and I
get a report that shows no data. Opening a subreport gives me the parameter
query window and I get the correct data. Somehow, my form isn't actually
passing criteria (or so it seems to me).

It sounds like there is a timing issue where the form is not
ready when the report need the data. Does the main report
open the form in Dialog mode?

A better/safer way to do this kind of thing is to open the
form first and have a button on the form to open the report
(instead of the other way around as you have it now).
 
Well, I thought I had it. And - to a degree - I do! Do you have any
suggestions as to why the report is repeating itself? For example, I
selected a semester and course number. There were 19 records in the query
when I ran it by itself. Using the form to get the criteria, the report
ended up being 114 pages long. Only the first six pages were the original 19
records worth of data. The rest of it repeated and repeated and repeated
and... Any thoughts on why this particular cosmic joke is occurring?

It was going so well...
 
Kathy said:
Well, I thought I had it. And - to a degree - I do! Do you have any
suggestions as to why the report is repeating itself? For example, I
selected a semester and course number. There were 19 records in the query
when I ran it by itself. Using the form to get the criteria, the report
ended up being 114 pages long. Only the first six pages were the original 19
records worth of data. The rest of it repeated and repeated and repeated
and... Any thoughts on why this particular cosmic joke is occurring?


This now sounds like the main report's record source query
includes the same data as the subreport (19 records times 6
pages = 114 pages).

If the main report isn't supposed to diaplay any data of its
own, then make sure its RecordSource property is blank. If
thereport is more complicated than that, post back with both
the main report's and the subreport's record source queries.
 
My hero!!! That was exactly the problem. It didn't even occur to me...

I was out for a few days and didn't get to read your note or try it until
today. Worked like a charm!

Thank you VERY much, Marsh!
 
Back
Top