Thread: One last try
View Single Post
  #2  
Old May 28th, 2010, 04:40 PM posted to microsoft.public.access.gettingstarted
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default One last try

You should not store calculated data as it will be in error if records are
revised. Whenever the calculation results are needed it should be done then
in a query.

First you have got to have a field that has common data in both tables so
you know which record from table A to use with record from table B.

BACKUP DATABASE BACKUP DATABASE BACKUP DATABASE

Then in query design view put both tables in the space above the grid.

Click on the common data field in table A and drag to the common data field
in table B. This will create a connecting line.

In the FIELD row of the grid type this --
My_Total: [Table A].[current] + [Table 2].[out]

If there may be any null fields then use this --
My_Total: Nz([Table A].[current], 0) + Nz([Table 2].[out], 0)

Click on the 'Total' field of Table A and drag to the FIELD row. Click on
query type and select Update Query. Copy the formula only (all after the
colon) into the Update To: row of the grid below 'Total' in the grid.

Run the query.

--
Build a little, test a little.


"HubbyMax" wrote:

Thought I would give it one more try. How do I run a calculation that uses a
field from 2 different tables?

Table A - field, current
Table 2 - field, out

current - out = ? to be placed in 'total' field in Table A