Expression box vs. text box for calculations

K

KLaw

I have a form for Purchase Orders and I have a repeating table with items to
be ordered. I would like to have an order total and have read every thread
about doing this. My dilemma is that in order to calculate the total
correctly, it seems that I need to use an expression box, but I want to store
the calculated value in my database; therefore it seems that I need to have
the total in a text box. The problem with a text box is that I can't seem to
get the calculation to work (I get a binding error that says "You have chosen
to bind a non-repeating control to a repeating field or group...". Then it
will only display the first item's extended cost instead of the desired
sum(@ExtendedCost). What am I doing wrong? Anyone?
 
G

Greg Collins [InfoPath MVP]

The error should give indication of what you need to do.

You have your field in a repeating group, yet on the form, you are placing the field by itself (not in a repeating group). Since it's not repeating in the view, it can only display one value (which in this case is the first value). To fix the issue, either make the group not repeating (probably not an option) or place the field in a repeating section/table in the view.

As a side note, since you want to store the calculated value, you definitely want text box and not expression box.
 

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