two source for report!!

  • Thread starter Kaspro via AccessMonster.com
  • Start date
K

Kaspro via AccessMonster.com

Hi everyone, i got a problem for my report, i got two tables which are
expenses and income for my project, and they cant be related in tables, so i
managed to use a subreport to show all my income, but what i cant do that i
want to calculate the total expenses - total income, and unfortunately i
cant assign any values to any textbox in the report using VB!!!!!
So how can i use two values from two unrelated tables in my report!
Thanks all.
 
M

Marshall Barton

Kaspro said:
Hi everyone, i got a problem for my report, i got two tables which are
expenses and income for my project, and they cant be related in tables, so i
managed to use a subreport to show all my income, but what i cant do that i
want to calculate the total expenses - total income, and unfortunately i
cant assign any values to any textbox in the report using VB!!!!!
So how can i use two values from two unrelated tables in my report!


The income total can be calculated in the subreport's report
footer using a text box (named txtTotakIncome) with the
expression
=Sum(incomeamount)

Then the main report can calculate the net income by using a
report footer text box with the expression
=subreportcontrol.Report.txtTotalIncome-Sum(expenseamount)
 
K

Kaspro via AccessMonster.com

Here's what i did: i created a textbox in the subform called 'SumIncome' and
assigned it the value of the sum total of income and in the main report i
added a textbox and assigned to it this value
=Reports![Income subreport]![SumIncome],
And what it gave me is this value "#Name?"
So what did i do wrong?!
 
K

Kaspro via AccessMonster.com

And i tried this now and gave me the same result:
=Reports![Total Expenses]![Income Subreport].Report![SumIncome]
 
M

Marshall Barton

Kaspro said:
And i tried this now and gave me the same result:
=Reports![Total Expenses]![Income Subreport].Report![SumIncome]


The reference must use the name of the subreport
**control**, which may be different from the name of the
report object displayed in the control. Double check the
name of the subreport **control** in the main report and
either change it to Income Subreport or change the reference
to use the name of the control.
 

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

Similar Threads


Top