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

Aid in the use of AutoSum

Status
Not open for further replies.

markswan20

Technical User
Jun 17, 2005
58
GB
Hello again folks

Thank you for all your help with my last problem i now have another question this time it's a lot less technical.

I have 8 boxes on a form once a product is selected the price automatically is displayed in the box next to it.

What i am trying to do is get the totals box at the bottom of my form to add up all the used fields some may use only 2 but others may use them all.

I know how to use autosum but it's not enabled on my database is this because i'm not using it correctly or because it's not available.

Kind Regards
Mark
 
Hallo,

Assuming the boxes containing the prices are text boxes called txtValue1, txtValue2 etc.

Make the controlsource of the txtTotal box:
=val(nz([txtValue1],"0")) & val(nz([txtValue2],"0")) & val(nz([txtValue3],"0")) & val(nz([txtValue4],"0")) & val(nz([txtValue5],"0")) & val(nz([txtValue6],"0")) & val(nz([txtValue7],"0")) & val(nz([txtValu8],"0"))

The = means it is a calculated control which should update as required.
The Nz specifies (in the 2nd parameter) the value to use if the first parameter (ie the box you're writing the value in) is Null
The Val means take the numeric value of the Nz bit (ie the box value or "0")

- Frink
 
Thanks for you reply Frink,

It's adding the two boxes together

i'e box 1 is 25 box 2 is 50

Total it displays =2550 not 75 as it should

 
Hallo,

D'Oh! Try putting + instead of & in my line above

- Frink
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top