View Full Version : calculate textbox from 2 listboxes


casey
12-05-2000, 09:57 AM
I’m using two list boxes on a form. Each list box runs its own query simply displaying a quantity from a table where PartID = AnyNumber. (i.e. List1.RecordSource = select QuantityAcquired from Orders where PartID =1; and List2.RecordSource = select QuantitySold from Sales where PartID =1 http://www.access-programmers.co.uk/ubb/wink.gif. Both queries run successfully and each listbox displays the proper value.

I also have a textbox on the same form that I wish to subtract the values in the listboxes(=[List1] – [List2]).

Here’s the problem...The calculated value in the text box is displayed only after the user clicks in each of the listboxes. I would prefer that the text box automatically display the result of this calculation. Any Solutions for this? Thanks.