adding or summing within a record

J

Jed

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.
 
F

fredg

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
 
J

John Nurick

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)".
 
J

Jamie Collins

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.

--
 
D

Duane Hookom

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
 

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