Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

Calculated Field in Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
HG - 06 Jul 2007 17:08 GMT
I have four separate fields (numbers) in a form that I would like add
together into a total field for cross checking.
The fields would be something like this:
Warehouse1    Warehouse2    Warehouse3     TotalCount

The TotalCount field would be calculated as the first three fields are
entered (first three added together) for reference purposes only.
Is there an easy way to accomplish this. I have tried putting in formula for
TotalCount in through properties, but I keep getting Name# or Error in the
field.
Any assistance would be greatly appreciated
Signature

HG

Klatuu - 06 Jul 2007 17:16 GMT
You can use the Control Source property of TotalCount to do this, because I
know you are not actually storing a calculated value in a field :)
=Nz(Warehouse1,0) + Nz(Warehouse2,0) + Nz(Warehouse3)

Signature

Dave Hargis, Microsoft Access MVP

> I have four separate fields (numbers) in a form that I would like add
> together into a total field for cross checking.
[quoted text clipped - 7 lines]
> field.
> Any assistance would be greatly appreciated
HG - 06 Jul 2007 17:42 GMT
Thank you for the quick response, one question, what does the Nz in your
example represent? And does the ,0 need to be after all the fields added
together? I noticed it was only in the first two.
Thank you again for your help.
HG

> You can use the Control Source property of TotalCount to do this, because I
> know you are not actually storing a calculated value in a field :)
[quoted text clipped - 11 lines]
> > field.
> > Any assistance would be greatly appreciated
Klatuu - 06 Jul 2007 17:48 GMT
Should be in All 3.
=Nz(Warehouse1,0) + Nz(Warehouse2,0) + Nz(Warehouse3,0)

The Nz function converts a Null value in the variable, field, or control in
the first argument to the value in the second argument if the first argument
is Null.  It is necessary because all controls for a new record are Null
unless there is a default value specified.  Any value added to Null returns
Null, so you would not see the total until all 3 controls are filled.
Using this method, it converts them to 0 so the addition will work as soon
as a value is entered in any one of the controls.
Signature

Dave Hargis, Microsoft Access MVP

> Thank you for the quick response, one question, what does the Nz in your
> example represent? And does the ,0 need to be after all the fields added
[quoted text clipped - 17 lines]
> > > field.
> > > Any assistance would be greatly appreciated
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.