Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sub report display 2

Status
Not open for further replies.

Amidala

MIS
Sep 5, 2001
7
0
0
AU
I have created a subreport to display the total number of issues assigned to each person in my database. For example:

Tim - 5 issues
Fred - 4 issues
Susie - 1 issue

etc

This subreport displays fine on its own, but within my main report, it is only showing one person's name. I have it in the page footer and it would seem the problem is the layout, but I have no clue what I need to check to rectify it so that all the details are shown on the final page of my report.

Any ideas anyone?

All help is much appreciated :)

'Amidala'
 
Check to see if the Child Fields and Master fields of the SubReport object in your report are set. If the subreport is set to Continuous and the query provides for all of the records then it must be that the Child and Master fields are selectively displaying only some type of matching records.

Check this out and get back with more info.

Bob Scriver
 
Hi Bob,

I checked the subreport and the child and master fields are set to be linked to a particular field (AssignedTo). I don't see any settings for printing that refer to Continuous or otherwise. I have set the properties to 'Can Shrink' and 'Can Grow'. I don't know what the problem is - I am using Access 2000.

Any further suggestions?

Thanks

'Amidala'
 
Howdy

Excuse me for jumping in, but I am trying to solve this exact issue. Last Fall, I was using the reports for an invoice. The invoice has a header and detail section. The report detail section usually has many transactions per invoice. Some transactions have additional charges and/or credits. These are stored in seperate tables, linked by transaction number. Our customers require some explanation for additional charges/credits, so I created two subreports in the report footer. The sub-report is correctly linked to the main report. However, only the last record prints in the subreport.

I did not find an answer before, so I did a work around. Now, I really do want to find the answer. I guess my question is: has anyone EVER been able to get a subreport to print multiple rows, when located in the report footer, and ONLY using the standard linking method????
 
I think you both are having the same problem. First of all my post was in error when I referred to Continuous. Had one of the "Sometimers" moments. That is a property on a subForm.

Now, there are two ways to fill the subform with all of the records that you are suggesting.

1. Using the Master Link field and Child Link field. You both seem to be aware of these fields and they must both be of the same data type and value for a match to occur and have the records displayed. One thing that I have had trouble with in the past is when the field names in both the Master table and the Child table are the exactly the same. I struggled with that for sometime. It was resolved when I changed the actual name in the table of one or the other and ACCESS could then figure out the linkeage situation. The Can Grow property is key in allowing all of the records to be displayed.

If only one record is displayed then one of two things is happening. The report subform object cannot expand in size so the OnGrow property is not set properly or the number of records matching the linkeage of the Master/Child fields is only that one record.

2. Another way to have this work is to set a Global variable with the Master Field value. Create a Module function that passes this value.

Global MasterValue as Variant
Function MasterValue()
MasterValue = vMasterValue
end Function

Use this Function in a query that is the record source of your SubReport. You should remove all references to the Master and Child Link fields in the SubReport Object on the main report with this option. You have to reassign the vMasterValue for each master record. This works real well but the SubReport should also.

At this point that is all I have for you. Sometimes I have had to delete the SubReport object and initiate it once again to get it to work. You have to do those type of things but I have found that at times ACCESS gets all tied up in knots during the design phase especially if the programmer does something a little out of the ordinary during the programming of the report, form, etc.

Good luck.

Bob Scriver
 
Thanks Bob!

Just removing the Link Master/Child references actually fixed my problem completely! I didn't perform all the other steps suggested as this fixed it.

I so appreciate your help :)
Hopefully you have also helped demoman :)

'Amidala'
 
FYI - Even though the Main and subreport link was relationally correct, it was not part of the filter conditions of the main form. That seems to be why I either got all (links removed and filter conditions ignored), or one row (correctly filtered, but only last row in recordset from main report. I modified the subreport's query and added the same columns as the main report's filter. Then I changed the Main/subreport to THAT column. Now it works. Thanks for the advise.!
 
I am having a similar problem.

Recently upgraded my database from Access 97 to 2000 and the subreport link is asking for parameters when I try and run the main report. No problems previously. No problems when I run subreport individually.

Any ideas?

Cheers,
Matt Matt Jenkins
Information Engineer - EDS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top