adding or summing within a record

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

Guest

Hi,

I have switched over from Microsoft works database and simply want to sum
several fields in a record to a "total" . This was quite easy in works I
can not figure out how it is done in Access.

Thanks for your help.
 
Jed said:
Hi,

I have switched over from Microsoft works database and simply want to sum
several fields in a record to a "total" . This was quite easy in works I
can not figure out how it is done in Access.

Thanks for your help.

You cannot perform a calculation directly in an Access table.
You can, however ....
In a Query:
Total:Nz([Field1],0) + Nz([Field2],0) + Nz([Field3],0)

Or... directly in the form you are using, or in a report, add an unbound
control.
Set it's control source to:
=Nz([Field1],0) + Nz([Field2],0) + Nz([Field3],0) + etc...

Look up the NZ function in VBA help

The above sum should NOT be saved in any table.
Anytime you need the Total, simply re-calculate it, as above.

Fred
 
Hi Jed,

You need to create a query that returns the records you're interested
in, and turn it into a 'totals' query. See Access Help for more,
especially the topic "Total records in a query (MDB)".
 
I have switched over from Microsoft works database and simply want to sum
several fields in a record to a "total" . This was quite easy in works I
can not figure out how it is done in Access.

This is a very basic question, indicating you need to learn some
fundamentals. I think you either need to learn SQL (http://
www.sqlcourse.com/) or learn how to use a tool that writes SQL for you
(http://office.microsoft.com/en-gb/access/HP051884071033.aspx).

Jamie.

--
 
In addition to other good comments, it seems your table is still a
spreadsheet/worksheet. Needing to add values across fields rather than across
records generally suggests an un-normalized table structure.
--
Duane Hookom
Microsoft Access MVP


fredg said:
Jed said:
Hi,

I have switched over from Microsoft works database and simply want to sum
several fields in a record to a "total" . This was quite easy in works I
can not figure out how it is done in Access.

Thanks for your help.

You cannot perform a calculation directly in an Access table.
You can, however ....
In a Query:
Total:Nz([Field1],0) + Nz([Field2],0) + Nz([Field3],0)

Or... directly in the form you are using, or in a report, add an unbound
control.
Set it's control source to:
=Nz([Field1],0) + Nz([Field2],0) + Nz([Field3],0) + etc...

Look up the NZ function in VBA help

The above sum should NOT be saved in any table.
Anytime you need the Total, simply re-calculate it, as above.

Fred
 
Back
Top