PDA

View Full Version : Solved: workout



whitewidow
03-02-2007, 05:03 PM
i have 3 textbox.

one textbox is for value
second textbox is for percentage
third textbox is for calculation output.

a command button which worksout textboxone * textboxtwo / 100 and this outputs to the third textbox.

i have done this coding but does not work.

me.textboxthree.text = me.textboxone.text * me.textboxtwo.text / 100

Bob Phillips
03-02-2007, 05:23 PM
me.textboxthree.text = Val(me.textboxone.text) * Val(me.textboxtwo.text) / 100

whitewidow
03-02-2007, 05:31 PM
this gives me an ouput of 0, which means it is not doing the calculation

Bob Phillips
03-03-2007, 03:09 AM
Works fine for me as long as I put numbers in.

whitewidow
03-03-2007, 12:09 PM
Works fine for me as long as I put numbers in.

i do put numbers up still no luck

Bob Phillips
03-03-2007, 02:28 PM
Post the workbook.

whitewidow
03-03-2007, 06:57 PM
Post the workbook.
here is an example of the workbook

lucas
03-03-2007, 07:25 PM
Maybe.....
Private Sub cmdcalculate_Click()
Me.txtrequired.Value = Me.txtprice.Value * (Me.txtpercent.Value / 100)
Me.txtprice.Text = Format(Me.txtprice.Value, "? #,###,##0")
Me.txtrequired.Text = Format(Me.txtrequired.Value, "? #,###,##0")
End Sub
surely an easier way to do the format:( ... commented out the textchanges

you were also using txtinterest instead of txtpercent

Bob Phillips
03-04-2007, 03:21 AM
The ? sign throws it

Try



Me.txtrequired.Text = Format(CDbl(Me.txtprice.Text) * CDbl(Me.txtinterest.Text) / 100, "? #,###,##0")

whitewidow
03-04-2007, 03:58 AM
thanks people this has been solved which was a minor error caused by me