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

Percent calculation in subforms

Status
Not open for further replies.

cntrintern

Technical User
Jul 24, 2001
12
US
I have a report that is composed of several subreports put together. I have also made code in the On Open procedure of this main report that would calculate a precentage that would be different for each record listed in the report.
I added a text box in each subreport named for the calculated information, [Per]. BUT when I open the main report it acts like a parameter value, that I must enter, even thought it should be defined in the code. Are there any suggestions on how to handle this? I think the solution should be simple, I just can't seem to figure it out. Please help! Thank you.

-cassie
 
I don't know if this is the answer to your question (there didn't seem to be one in your post). I have a report I do with two sub-reports and I need to calculate a percentage based on a value in each subreport that is then placed on the main report, it is on a per record basis as well. I simply made a calculated field that finds the value in the subreport and does the math. Here's the control source if it helps you:


=[rsubReturns].[Report]![txtTotTotalQty]/[rsubSales].[Report]![txtTotTotalQty] Joe Miller
joe.miller@flotech.net
 
I don't know if it will work, but i will try with some other info I have gotten. Thank you! I'll try to expalin the percentage calulation better and maybe someone can help me translate into how I could use the information already given. I count how many categories, each category is a field, the user selected on a form using If..Then for selected=1 and not=0. Then I add them all up for a TOTAL. Then I have many levels of queries that are assigned values based on how many categories they represent. If there are records in a query that has four categories then it is assigned the value MEET = 4. Then I have a calculation Per= (MEET/TOTAL)*100. This is all in the On Open event procedure. I want to get the calculation in each record of the subreport. I hope this makes sense.
Thank you for your help.

-cassie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top