467,148 Members | 1,283 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,148 developers. It's quick & easy.

new to using format$(xxxxxxx."currency")

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?

Bill
Jul 17 '05 #1
  • viewed: 8541
Share:
1 Reply
"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")

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Dan C Douglas | last post: by
3 posts views Thread by shill57957@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.