Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

total %

Status
Not open for further replies.

is1ma1il

MIS
Feb 15, 2002
51
US
Hi,

I have 5 numeric fields, with % inside I wish to add these together in a totals field (It updating when I am putting the numbers in above). I know one way of the totals box control being the sum, but that way it does not get written to the table it is visible in the form only.

anyone?

 
If you want a field in the table to be updated after you change another field in a form you use the afterupdate-events of the fields you are changing.

Example:

You have fields Value1 and Value2 with data you will change and a field Total which is the total. These three fields have a controlsource that is linked to a field in the underlying table.
You make a function like this:
Private Function CalculateTotal()

Me.Total = me.Value1 + me.Value2

End Function

In the AfterUpdate-event of Value1 and Value2 you put =CalculateTotal()

Hope this helps.

Greetz,

Dirk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top