How can I insert a calculated field from FORMS to a REPORT?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Say I create a table with three fields and label them a, b and c.

I then create a form where the user inputs a number for a and b. The c field
then calculates the sum (i.e. a + b = c ) This works fine.

Here comes the problem. When I create a report, and input all three fields
into the detail section of the report, the only visual numbers that appear
are a and b. The value of c is always zero. What am I doing wrong?

Would very much appreciate the help. Thanks
Sean
 
Hello,

Say I create a table with three fields and label them a, b and c.

I then create a form where the user inputs a number for a and b. The c field
then calculates the sum (i.e. a + b = c ) This works fine.

Here comes the problem. When I create a report, and input all three fields
into the detail section of the report, the only visual numbers that appear
are a and b. The value of c is always zero. What am I doing wrong?

Would very much appreciate the help. Thanks
Sean

1) Calculated fields should not be saved to a table. Anytime you need
the result of a calculation, re-calculate it.
So... you can delete field C from the table.

Also, it would of benefit you to differentiate between a Field (which
is the place in a table that stores data) and a Control (which is an
object on a form or report that displays or calculates data.
Tables contain Fields. Forms and Reports contain Controls.

2) The easiest way is to just repeat the calculation on the report
using an unbound text control:
= a + b

3) If the calculation has been done on a form AND THE FORM IS OPEN,
you can refer, using an unbound control on the report, to the control
on the open form:

= forms!FormName!ControlName
 
sean said:
Say I create a table with three fields and label them a, b and c.

I then create a form where the user inputs a number for a and b. The c field
then calculates the sum (i.e. a + b = c ) This works fine.

Here comes the problem. When I create a report, and input all three fields
into the detail section of the report, the only visual numbers that appear
are a and b. The value of c is always zero. What am I doing wrong?


The c fiels should NOT be in the table.

The report should perform the same calculation as the form.
 
Back
Top