subreport master/child

T

Toxalot

Does the master field need to actually have a control on the main
report? It's one of the fields in the recordsource, but it prompts me
for it if I don't actually add a control to the report.

The master field is tblProfiles.lngProfileId

Also, every time I open the report for the first time I get prompted
for tblProfiles. If I don't enter anything and simply click ok the
report shows as expected. If I go to design mode and back to preview,
I'm not prompted again for tblProfiles, but if I close and reopen then
I am prompted again.

If I remove all the subreports from the main report I am no longer
prompted for tblProfiles.

I've been scouring the code for a typo, but haven't noticed one. Why
would I be prompted for tblProfiles?

Jennifer
 
A

Allen Browne

Firstly, yes: you often need to add the text box to the report if you want
to refer to the field. Set the text box's Visible property to No if you
wish.

This is different to forms, and it has to do with the way Access optimises
data for the report. It doesn't bother fetching all the fields if it can't
see that it needs them. It will fetch the field it is the Control Source of
a control or a group level.

If you are still stuck, does the report's source query return multiple
fields named lngProfileID? For example, perhaps a tblProfiles.lngProfileID
and also a Table2.lngProfileID? If it does, is there a possiblity to:
a) uncheck the Show box in query design under the 2nd field so it doesn't
get included, or
b) alias the 2nd field, by typing another name in front of the other field,
e.g.:
MyOtherProfileID: Table2.lngProfileID
You will probably find that this simplies things in the report. You can drop
the "tblProfiles." prefix, and concentrate on just the field name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top