Problem in SubReport

  • Thread starter Rani VSPL via AccessMonster.com
  • Start date
R

Rani VSPL via AccessMonster.com

Hi Group
I'm new to access & so any help regarding my problem is highly appreciated.I have a report in which I need to give options to my client to dynamically filter the contents. I am retrieving data from Three tables(Crew Info,Truck Assignments & Parts InstalledInfo; Common relation is Crew No) and so I've created 2 subreports (Truck Assignments & Parts InstalledInfo). The main report gives Crew Info.
So from the form I had given two checkboxes, one each for selecting whether to display TruckAssignments & Parts Installed Info. Now on check of these chkboxes I need to make the sub reports visible.
I tried to make the subreport invivsible on click of GenerateReport Button. But it did'nt work out.
Also can i set the recordsource of subreport on the checkbox updates. If so how?
How can I do that.
Plz help me out of it
 
M

Marshall Barton

Rani said:
I'm new to access & so any help regarding my problem is highly appreciated.I have a report in which I need to give options to my client to dynamically filter the contents. I am retrieving data from Three tables(Crew Info,Truck Assignments & Parts InstalledInfo; Common relation is Crew No) and so I've created 2 subreports (Truck Assignments & Parts InstalledInfo). The main report gives Crew Info.
So from the form I had given two checkboxes, one each for selecting whether to display TruckAssignments & Parts Installed Info. Now on check of these chkboxes I need to make the sub reports visible.
I tried to make the subreport invivsible on click of GenerateReport Button. But it did'nt work out.
Also can i set the recordsource of subreport on the checkbox updates. If so how?


These operations need to be done in the report itself. Most
of the time, the main report's Open event procedure is the
appropriate place for the code that sets properties in the
main report (not in a subreport).

Me.srpTruck.Visible = Me.Forms!theform.chkTruck
Me.srpParts.Visible = Me.Forms!theform.chkParts

As for setting the subreport's record source (and other
properties), this would have to be done in each subreport's
Open event. This can get tricky because it can only be done
the first time a subreport appears in the main report. Most
likely, you want to use different criteria. If so, then the
first ting you should try is using the Link Master/Child
properties. If that can not do what you want, the next
thing to try is to make the subreport query refer back to
the form controls.
 
R

Rani VSPL via AccessMonster.com

Thanks Marshall,I made the subreports invisible in the Open Report event depending on the checkbox selection. Till now it works fine.
But now I need to make another report Wherein the data can be from multiple tables like Parts Ordered, Parts Damaged, Parts Repaired etc..
Now the user may want to filter the report on Query by date or on Query by Parts. He will also select which tables Data must appear on the report through checkbox. How will I do that?
Also how do I create Master-Child Links for report.
Please spare some time of yours and help me out.
Thanks
 
M

Marshall Barton

Rani said:
Thanks Marshall,I made the subreports invisible in the Open Report event depending on the checkbox selection. Till now it works fine.
But now I need to make another report Wherein the data can be from multiple tables like Parts Ordered, Parts Damaged, Parts Repaired etc..
Now the user may want to filter the report on Query by date or on Query by Parts. He will also select which tables Data must appear on the report through checkbox. How will I do that?
Also how do I create Master-Child Links for report.


The LinkMaster/Child properties (of the subreport
**control**) are normally set at design time. LinkMaster
specifies a main report record source field or a bound or
unbound control. The LinkChild property must be a field in
the subreport's record source table/query. The presences of
the properties specifies that the subreport record's link
child field's value must match the value in the main
report's link master field/control.

For example, if the main report display the data for an
invoice (invoice number, customer name, address, date, etc),
then the LinkMaster property would be the invoice number.
The subreport's record source would be for the invoice
details table and the link child property would specify
table's invoice number field used as the foreign key.

With that arrangement, the invoice report would only display
details related to the invoice in the main report without
using any filtering or query parameters.

This capability can also be used to select specific data to
be displayed in a subreport. For example, if a transactions
table contained records for both goods and services using a
type field with a value of 1 for goods and 2 for services,
then you can set a main report text box to 1 so you'll only
see goods in the subreport or set it to 2 to only see
services.

Your other question about another report with multiple
tables is too general for me to address in a newsgroup
response. You should frame your question in more specific
terms that ask about a single topic in separate threads.
 

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