Its important to understand that a table stores data, a report presents it
along with information derived from the data. Data are values of a
particular attribute, e.g. Widget might be a value of an attribute Product;
200 grams a value of attribute Weight. Attributes are represented by columns
in a table, so these could be columns in a table Products. In another
related table OrderDetails, a column might represent an attribute Quantity.
If someone orders 10 Widgets the total weight is 2000 grams, but this is an
aggregated value computed by the product of Weight and Quantity. This would
not be stored in a table but computed when required. This can be in a query
or in a computed column in a report. So a report of orders might have the
following in its
detail section
Product Quantity Total Weight
Widget 20 2000
The product and quantity would be bound text box controls in the report, i.e.
their ControlSource properties would in each case be the name of the product
and quantity columns (aka fields) in the tables, but the Total Weight text
box would be an unbound computed control, with a ControlSource property of =
[Quantity]*[Weight]. In this case the computation is across the row of data.
Taking things a step further, an order will probably have a number of order
lines, and we might want to get the total quantity of all items ordered and
the total weight of all those items. This is done by adding unbound text
boxes to the report footer. To get the total quantity the CiontrolSource is:
=Sum([Quantity])
To get the total weight of all items we don't sum the computed TotalWeight of
each item, but the original expression, like so:
=Sum([Quantity]*[Weight])
If the report is for just one order these text boxes could go in the report
footer and give the totals for that one order. If the report covers more
than one order then this would give the totals for all the orders, which we
might well want, but we'd also want the totals for each order as separate sub-
totals. To do this we'd group the report by a column such as OrderNumber,
which is done in report design view via the Sorting and Grouping dialogue,
and give the group a group footer. This would contain two text boxes
identical to those in the report footer, with exactly the same ControlSource
properties.
One thing to be aware of is that you can only aggregate values like this in a
group or report footer (or header), not in a page footer (or header). It is
possible to show page totals in a page footer, but it has to be done
differently.
When you build a report like this it will reflect the current data in the
underlying tables whenever the report is opened, whether on screen in print
preview or sent to a printer. The data shown in the report can be restricted
each time, however, by basing the report on a query which includes parameters
which prompt the user for one or more values when the report is opened.
You'll find information about parameters in the Help system. In the above
case for instance the report might be restricted to a particular customer, or
it might be restricted to orders between two dates, or a combination of both
of these.
I hope that the above, while obviously not directly analogous to your
situation, will give you a general idea of how reports work. I'd be happy to
provide more specific guidance related to your specific needs, but would need
a more detailed description of what data is held in the columns of your table
or tables, and just how you want it presented in a report, not only in terms
of the layout, but also in how you might want to restrict at runtime what
data is printed, e.g. by entering a start and end date. Unfortunately I
shall be away for the rest of this week, so would not be able to get back to
you before Sunday at the earliest. It may well be that others will be able
to step in and help you in the meantime however.
Ken Sheridan
Stafford, England
Mr. Sheridan - Thank you for answering my question. I did try your suggestion
and it comes up as:
#error
I'm not sure what I am doing wrong. Ideally I would like to retrieve data
from the table, go into Report and print the info I need, with a total at the
end. If I group it will I be able to accomplish it or am I stuck computing
each report as they are generated? I was asking about the ability to total a
Table for almost the same reason; pull the info I need and at the same time
see the totals on that field - without having to go to a Report. Again, I
appreciate you taking the time to answer my question.
To delete the field from the report first open the report in design view.
Then select the control bound to field in question and delete it. Do the
[quoted text clipped - 34 lines]
like to get it to calculate it at the bottom of the table portion and the
report as well. Please help.