"Bill Stanard" <ws******@palmertrinity.org> wrote in message
news:4f**************************@posting.google.c om
I have had no success using the format function as follows (the two
lines of code run one after the other):
'displays a running total of lblAmtdue.Caption
'contents in txtTotal.Text
txtTotal.Text = lblAmtdue.Caption + Val(txtTotal.Text)
'tries to format contents of txtTotal.Text as currency; doesn't work
txtTotal.Text = Format$(txtTotal.Text, "Currency")
Of what obvious formatting error am I guilty?
the first thing I'd do is eliminate all the implicit data conversions
Dim cTotal As Currency
cTotal = CCur(lblAmtdue.Caption) + CCur(txtTotal.Text)
txtTotal.Text = Format$(cTotal, "Currency")