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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding values together in a form - Is it possible???

Status
Not open for further replies.

pd2222

Programmer
Oct 15, 2001
14
0
0
GB

Not sure if the following is possible:

I would like the 'User' of the database (who cannot get into the design view) to be able to calculate a sum in an existing text box of a form e.g. 2 + 2 (Access automatically produces the answer)

However, on some occasions these boxes may already contain a total from a control source.

I know that I used to do this in Excel by '=Sum(2 + 2)' is this type of thing possible in Access or am I wasting my time???

Please help a distraught Novice Database Developer!

Keza

 
Yes.

If the text box is not bound then you can put this in the control source of the box you want the sum in...

=Sum([TextBox1] + [TextBox2])

If the text box is bound then in TextBox1 and TexBox2's After Update event you can put...

TextBox3 = TextBox1 + TextBox2


ljprodev@yahoo.com
ProDev, MS Access Applications B-)
 
The calculated control should be unbound. However, if you deem it necessary to be bound to something, & include a refence to itself(how you activate this calculation is up to you, because it shuold be done through the recordsource, making it unbound), it should be able to add its own value to another. If it is unbound, it will not initially contain a value, so refrencing itself would neither be applicable nor work...
James Goodman
j.goodman00@btinternet.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top