Good day to you!
I have this problem with calculation. I have Quantity(txtQty) and Unit Price(txtUprice) field and output the product in the Amount(txtAmount) field. If works just fine if I remove the code to format the contents of the textbox. But my code below doesn't work, it gives a wrong product in the txtAmount.text
Kindly check my code...
Private Sub txtQty_Change()
txtQty.Text = Format(txtQty.Text, "#,###"
txtQty.SelStart = Len(txtQty.Text)
txtAmount.Text = Val(txtQty.Text) * Val(txtUprice.Text)
txtAmount.Text = Format(txtAmount.Text, "#,###.00"
End Sub
Private Sub txtUprice_Change()
txtUprice.Text = Format(txtUprice.Text, "#,###.00"
txtUprice.SelStart = Len(txtUprice.Text)
txtAmount.Text = Val(txtQty.Text) * Val(txtUprice.Text)
txtAmount.Text = Format(txtAmount.Text, "#,###.00"
End Sub
Any help will be greatly appreciated.
thanks in advance
I have this problem with calculation. I have Quantity(txtQty) and Unit Price(txtUprice) field and output the product in the Amount(txtAmount) field. If works just fine if I remove the code to format the contents of the textbox. But my code below doesn't work, it gives a wrong product in the txtAmount.text
Kindly check my code...
Private Sub txtQty_Change()
txtQty.Text = Format(txtQty.Text, "#,###"
txtQty.SelStart = Len(txtQty.Text)
txtAmount.Text = Val(txtQty.Text) * Val(txtUprice.Text)
txtAmount.Text = Format(txtAmount.Text, "#,###.00"
End Sub
Private Sub txtUprice_Change()
txtUprice.Text = Format(txtUprice.Text, "#,###.00"
txtUprice.SelStart = Len(txtUprice.Text)
txtAmount.Text = Val(txtQty.Text) * Val(txtUprice.Text)
txtAmount.Text = Format(txtAmount.Text, "#,###.00"
End Sub
Any help will be greatly appreciated.
thanks in advance