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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report summing problems. 1

Status
Not open for further replies.

Rubius

Programmer
May 12, 2000
57
CA
Ok, here we go again! I have a report that has the following pieces of data. Name, key, sn, job, desc, cost<br><br>I'll give you some typical data<br>John Doe 12 001 5050 blah&nbsp;&nbsp;20.00<br>John Doe 12 001 5050 blah1 30.00<br>John Doe 12 001 5050 blah2 40.00<br>John Doe 13 002 5051 blah4 28.00<br>John Doe 13 002 5051 blah5 40.00<br>John Doe 13 002 5051 blah6 45.00<br>John Doe 13 002 5051 blah7 67.00<br><br>There are tones of names that are different, but inside each name it looks roughly like this.<br>That is how the data is in the tables, I know that everything is the same but it's a warrenty report and the key, sn, and job are the same because it is referring to one machine while the work completed on it is the descriptions and cost is the cost. What I want is it to look like this:<br>John Doe <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12 <br>001 5050 blah&nbsp;&nbsp;20.00<br>001 5050 blah1 30.00<br>001 5050 blah2 40.00<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total 90.00<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;13<br>002 5051 blah4 10.00<br>002 5051 blah5 40.00<br>002 5051 blah6 50.00<br>002 5051 blah7 15.00<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total 115.00<br>Next name<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Next Key<br>etc<br><br>I've tried to do it with the wizard, but all it does is display the name, then the key and then the total of all the details, but it doesn't list them.<br>Thanks in advance
 
You need to split the report into a Main Report and Sub Report.&nbsp;&nbsp;In the Main Report you can use the wizard to take things such as Name and Key.&nbsp;&nbsp;Group on Name. This will leave the Key in the Detail section of the report.&nbsp;&nbsp;Open the Detail Section and place the subReport/subForm control (with the wizard on)on the form under the Key control in the Detail Section. This subReport will contain the following fields: Sn, Job, Desc, Cost, and Key(this is very important).&nbsp;&nbsp;the Wizard will ask you how do you want to link the two reports - choose define my own.&nbsp;&nbsp;Link the Key field on the Main report to the key field on the sub report.<br>Go into the sub report and format it the way you wish, set the default view to continuous form.&nbsp;&nbsp;I would make the &quot;Key&quot; field on the sub invisible.&nbsp;&nbsp;Make sure that you create a header and footer for the sub report.&nbsp;&nbsp;Place an unbound control in the report footer under Cost.&nbsp;&nbsp;Set its control source = Sum([Cost]).<br><br>This will keep your &quot;Key&quot; with its jobs and costs together and it will be grouped by Name.<br><br>Let me know how it works out.<br><br>Bob B.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top