Hi i am making a table where i have different currency fields showing the salary of different staff and then a total field where i can calculate each staff's salary on rent, transport etc... now how do i make the total field show the total i.e. addition of rent+transport+education

Dani AI

Generated

A short, practical note to complement the thread: keep the salary parts (Rent, Transport, Education) as separate numeric/currency fields and compute the Total when presenting or querying the data. is correct that queries or reports are appropriate for calculations; 's use of a form is equally valid for per-record totals during data entry. Storing derived totals in tables creates redundancy and risks inconsistent data when one of the components changes.

Common, safe expressions that work in Access:

In a query (Design grid, new column):

Total: Nz([Rent],0)+Nz([Transport],0)+Nz([Education],0)

On a form unbound textbox (Control Source):

=Nz([Rent],0)+Nz([Transport],0)+Nz([Education],0)

Notes and troubleshooting:

  • Nz avoids Null propagating into the sum; without it a Null field makes the whole expression Null.
  • Field/control names must match exactly (including spelling). Use the Expression Builder to reduce errors.
  • For totals across multiple records, use a Totals (Aggregate) query or set a report textbox to Running Sum.
  • Access 2010+ supports calculated fields in table design, but queries/forms/reports remain the recommended place for display calculations. If totals must be stored (for performance or archival reasons), populate them with a controlled update query or form-driven VBA and enforce consistency.

Recommended Answers

All 2 Replies

You do that in either a query or a report.

Hey thx a lot i got it done i used a form and did it. Thanks a lot

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.