Formating currency in text box

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

This is the code I got yesterday, but I'm still having
problems.

Private Sub txtHouseCost_AfterUpdate()
txtHouseCost.Value = Format(CInt(txtHouseCost.Value), "#
##0 $")
End Sub
When I enter a number it rounds up or down, I lose the
digits after the decimal, and the $ is at the left end of
the number. The other problem I have is if I move the $
to the front, $# ##0 , the total doen't work. I'm using
Total = Val(txtHouseCost.Value) + Val(txtLotCost.Value) +
Val(txtOptionCost.Value)
Any ideas to help this old struggling newbie?
 
Doug
This is the code I got yesterday, but I'm still having
problems.

Private Sub txtHouseCost_AfterUpdate()
txtHouseCost.Value = Format(CInt(txtHouseCost.Value), "#
##0 $")

=Format(txtHouseCost.Text, "$#,##0.00")
End Sub
When I enter a number it rounds up or down, I lose the
digits after the decimal, and the $ is at the left end of
the number. The other problem I have is if I move the $
to the front, $# ##0 , the total doen't work. I'm using
Total = Val(txtHouseCost.Value) + Val(txtLotCost.Value) +
Val(txtOptionCost.Value)

Total = CDbl(txtHouseCost.Text) + CDbl(txtLotCost.Text) etc...
 

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

Back
Top