calculation on textboxes

  • Thread starter enrico via AccessMonster.com
  • Start date
E

enrico via AccessMonster.com

my form have textboxes the everytime i click a button each will return a sum
query. how will i create another textboxes that will add all the sum that the
other textboxes returns?
 
J

Jeanette Cunningham

Hi enrico,
assuming that each textbox will have a number type of long, you could use
code like that below to calculate the sum.

Private Sub Total
Me.TheSumTxtbox = Nz(Me.[txtbox1],0) + Nz(Me.[txtbox2] ,0) +
Nz(Me.[txtbox3],0)
End Sub

You could call this sub in the code that updates the value of the textbox
when you press the button.

Replace txtbox1 etc with the real names of the controls.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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