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

S

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
 
F

fredg

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
 
M

Marshall Barton

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.
 

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

Top