sum text box values based on combo box look up

G

Guest

So I have 3 combo boxes each having two columns, within a form. Next to each
combo box is a text box that shows the price based on the selected product
from the combo box. How do I sum all 3 TEXT box values in another text box
called Total?

It looks like this

Combo box 1 (then select product) Text box 1 (shows price of
selected product)
etc.

Total text box (control source is =sum([Text1]+[Text2]+[Text3])

And it gives me #Error!

Thanx
 
G

Guest

There is no need for the sum, you would use the sum to add the values of few
records and not few fields

When you use it add to it the nz function, incase one one of the combo's has
no value it will replace it with 0. adding null will return a NuLL

So it will be
=nz([Text1],0)+nz([Text2],0)+nz([Text3],0)

Now are you sure that the amount is the first field in the combo or the Item
is the first one? if the amount is the second field then:

=nz([Text1].column(1),0)+nz([Text2].column(1),0)+nz([Text3].column(1),0)

Now you better give the fields more meaningful names, it will be easier for
you and for other to maintain the DB.
 

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