A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old May 9th, 2007, 08:36 PM posted to microsoft.public.access.reports
Sean
external usenet poster
 
Posts: 491
Default How can I insert a calculated field from FORMS to a REPORT?

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

  #2  
Old May 9th, 2007, 09:56 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default How can I insert a calculated field from FORMS to a REPORT?

On Wed, 9 May 2007 12:36:01 -0700, sean wrote:

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

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old May 9th, 2007, 10:19 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default How can I insert a calculated field from FORMS to a REPORT?

sean wrote:
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.

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:25 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.