Subreport link issue

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

Guest

I have a report, which people access by hitting a button on a form, which
then opens the report for the record to which the form is referring.

My problem is that my subreport (added via wizard) does not seem to
understand that it also should be pointing to the same record to which the
rest of the report is referring.

The wizard is linking them via the query that the report is based on "Show
all records where FVFUnNo = FVFUnNo in qryAwdRpt" But qryAwdRpt has lots of
records, and the result (I think) is that when I try to look at the main
report, it asks for the FVFUnNo. How do I get the subreport to look only at
the one record?

Thanks.
 
Have you looked at setting the Link Master/Child properties of the subreport
control? This will limit the subreport to records based on a value in the
main report.
 
When I check Master/Child properties of the subreport control, both say
FVFUnNo, and the source object is the main report. And this is what I would
expect would work.

When I delete the subreport, this opens just fine, apparently finding the
FVFUnNo with no difficulty.

When the subreport is there, it asks me to define the FVFUnNo.
 
Is the field FVFUnNo in the record source of both the main report and the
subreport?
You state the "source object is the main report". Shouldn't the source
object be your subreport?
 
You're right. My mistake.

When I view the properties box Data section of the subreport I get:

Source Object: Report:rptAwdFoot (which is my subreport)
Link Child Fields: FVFUnNo
Link Master Fields: FVFUnNo

FVFUnNo is in the underlying query for both the main report and the
subreport, and, in an effort to see if this would fix the problem (it did
not) it is now an invisible field on both the report and the subreport.

I'm still stuck.

Thanks.
 
Are you suggesting that you are seeing FVFUnNo values in your subreport that
don't match your main report even though you have this field in the Link
Master/child properties?
 
Pretty much, yes.

In this instance, it seems unable to determine what the FVFUnNo is, though
there is only one FVFUnNo, because that was prefiltered by the button on the
form that got to the report. I don't see multiple values, but it asks me
what the value is.

On a parallel set of forms and reports, inspired by the pie chart problem
you have been helping me with in a separate thread, the pie chart now shows
all EmpID's even though that is the Master/Child linking field. With three
employees and three possible benefits (salary, health, dental), I get nine
slices on my piechart instead of the desired three.
 
I'm lost when you state "prefiltered by the button on the form that got to
the report"... what asks you "what the value is"?

We can't see your report, subreport, error messages, fields, code, criteria,
data, etc. You need to be a little more explicit.
 
Well, I was going to try to explain in more detail, but to my great
confusion, and profound relief, the problem appears to have fixed itself over
the weekend, with no intervention from me or anyone else.

It should have worked the way I set it up. It now does work. Heaven only
knows what it was doing last week.

Thanks for your help anyway, I learned some things on the journey.
 
Back
Top