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

Adding field from a linked table into a form

Status
Not open for further replies.

Stevehewitt

IS-IT--Management
Jun 7, 2001
2,075
GB
Hey People!

Some info about the DB first:

Table1: information about the order, such as date, product type, invoice number, order number, delivery type etc.
Table2: specification / order details such as product number, price per unit, cost price per unit, type of unit etc.

The tables are linked by order number. When I run the form I have both tables in the query therefore I can use
Code:
FORMS!
to get totals from table 2.

The problem I have, is that I need to get a total (e.g. total amount of order, number of items ordered) from table 2 into a report, which the report is based on table 1 (general sales details).

Anyone know of a way I can get totals from a linked table into a report without having the report/form for the table I want the totals from open?

Thanks in advance,

Steve.
 
Steve,

The same method you used to create the form/subform relationship would also work for you using a report / subreport method. See this post for displaying totals from your subreport in the main report: thread703-753064

Hoc nomen meum verum non est.
 
Hey!

Thanks for the prompt reply.

Unfortunatly that method wouldn't work. The information I need isn't stored in the table of the order details. We sell timber, and sell on a meter cube basis. I need a total M3 of all records for each order. The problem is that on this form, I can't have the subform including the specification. (Sometime have over 100 records in an order).

I need a command that will add up all the records in a column of a table, and display it on a report, even though I don't want to display the table that hold the data I want to add up.

Thanks appreciated,

Steve.
 
The subreport could be formatted to only include the total(s) you are looking for. Another way to include totals would be to use an aggregate function like DSum as the control source of an unbound text box in your report. These functions can include criteria and can utilize record sources different from your main report....

Hoc nomen meum verum non est.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top