From: Wayne on 6 Jun 2010 04:43 I have several bound text boxes on a form: Txt1Result, Txt2Result etc. The value of each of these is based on a formula that draws a value from another series of textboxes: Txt1Input, Txt2Input etc. Therefore; Txt1Result = Txt1Input*SomeFormula, Txt2Result = Txt2Input*Someformula etc. The values in the "Result" textboxes is then summed into a "Total" textbox. TxtTotal = Txt1Result + Txt2Result etc. All textboxes are formatted as "fixed" to one decimal place. The problem I am having is this: The "TxtTotal" textbox is showing a value that is slightly different to the sum of the "Result" texboxes because it is summing the underlying figures in the "Result" textboxes that are in actual fact calculated to several decimal places, instead of summing the displayed figures in the "Result" textboxes that the user sees which are displayed to 1 decimal place. Is there are way to force the "Total" textbox to sum the figures in the "Result" texboxes as they are displayed to the user i.e. to 1 decimal place?
From: Marshall Barton on 6 Jun 2010 06:01 Wayne wrote: >I have several bound text boxes on a form: Txt1Result, Txt2Result >etc. The value of each of these is based on a formula that draws a >value from another series of textboxes: Txt1Input, Txt2Input etc. > >Therefore; Txt1Result = Txt1Input*SomeFormula, Txt2Result = >Txt2Input*Someformula etc. > >The values in the "Result" textboxes is then summed into a "Total" >textbox. TxtTotal = Txt1Result + Txt2Result etc. > >All textboxes are formatted as "fixed" to one decimal place. The >problem I am having is this: The "TxtTotal" textbox is showing a value >that is slightly different to the sum of the "Result" texboxes because >it is summing the underlying figures in the "Result" textboxes that >are in actual fact calculated to several decimal places, instead of >summing the displayed figures in the "Result" textboxes that the user >sees which are displayed to 1 decimal place. > >Is there are way to force the "Total" textbox to sum the figures in >the "Result" texboxes as they are displayed to the user i.e. to 1 >decimal place? Try changing the result text boxes to use: Txt1Result = Round(Txt1Input*SomeFormula, 1) -- Marsh
From: Wayne on 7 Jun 2010 00:56 On Jun 6, 8:01 pm, Marshall Barton <marshbar...(a)wowway.com> wrote: > Try changing the result text boxes to use: > > Txt1Result = Round(Txt1Input*SomeFormula, 1) > > -- > Marsh Thanks Marshall. Worked well.
|
Pages: 1 Prev: Virtual checkboxes Next: How to send a hit to a PHP web service |