View Single Post
  #5  
Old May 9th, 2010, 12:51 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Expression in forms

On Sat, 8 May 2010 06:06:04 -0700, Jamo
wrote:

Thank you so much for the information. I will delete that field out of
the table and create a report to do the total calculation, however for my own
curosity can that be done what I was trying to do in a form? I will follow
you advice and proceed from here


Well, you can't do calculations in tables - but you have at least three other
choices!

You can do a calculation in a Query by just typing the calculation expression
in a vacant Field cell:

Total: [FieldA] + [FieldB]

Or you can display a calculation on a Form by putting an expression in the
control source property of a form Textbox:

= [FieldA] + [FieldB]

The same technique works on a Report as well.

If you want to sum the value of a field across multiple records, you can also
do it three (or more) different ways: with a Totals Query; or in the Footer of
a Form or Report:

= Sum([FieldA])

So you're not losing much by being unable to do the calculation in a table.

SideNote: Access 2010 has sigh calculated fields in tables. In reality
they're a hidden query, and in fact this can be a useful technique, but you do
need to understand the underlying logic.
--

John W. Vinson [MVP]