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

Report from two transaction tables

Status
Not open for further replies.

nadms

MIS
Dec 29, 2001
5
MY
I'm kind of new to Access. I need to create a report that require information from 2 transaction tables. Here are my tables.
a) Employee
Code:
  Fields: -Employee ID (primary key)
          -Employee Name
c) Transaction1
Code:
  Fields: -Date
          -Employee ID
          -Revenue1
          -Revenue2
c) Transaction2
Code:
  Fields: -Date
    	  -EmployeeID
   	   -Expenses1
          -Expenses2
The Employee lD is linked to both the Transaction tables.
The first report is "Revenue - Employee within a date range" from Transaction1 table and the report is base on a query. To get the Total Revenue, I have =Sum([Revenue1]+[Revenue2]) in Control Source.

The second report is "Expenses - Employee within a date range" from Transaction2 table and the report is base on a query. The Total Expense is = Sum([Expenses1]+[Expenses2]) in Control Source.

I need another report that is similar to the first report. My form require me to enter the Date From and Date To and Employee Name. There should be a row in the report that allows me to show the Total Expenses figure also within the same date range from Transaction2 table. What I want to do is to minus the Total Expenses from my Total Revenue from Transaction1 to get the Actual Revenue.

I am using my second report as a subreport. My report seems to be able to capture records within the date range from the Transaction2.

I've tried to place a text box to show the Actual Revenue and have the following in the Control Source.
=(Sum([tblTransaction1]![Revenue1]+[tblTransaction1]![Revenue2])) -
(Sum([tblTransaction2]![Expenses1]+[tblTransaction2]![Expenses2]))
It doesn't work. Something seems to be wrong here.

Any ideas would be appreciated.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top