Number Format from Linked table

S

SharonInGa

My form pulls data from a linked table and calculates an annual return which
appears on a message box. How can I format the number to appear as ##.##
instead of 8.1243543234 ?

strMsg = "Annualized Return" ("me.Account &"," Me.Date): "& rst.feilds(0)
&"."&

Output = Annualized Return (Account Name, Date): 8.1243543234
 
M

Marshall Barton

SharonInGa said:
My form pulls data from a linked table and calculates an annual return which
appears on a message box. How can I format the number to appear as ##.##
instead of 8.1243543234 ?

strMsg = "Annualized Return" ("me.Account &"," Me.Date): "& rst.feilds(0)
&"."&

Output = Annualized Return (Account Name, Date): 8.1243543234


Use the Format function:

strMsg = "Annualized Return (" & me.Account & "," & Me.Date
& "): " & Format(rst.fields(0), "0.00") & "."

SHaron, in the future, when posting an expression or code,
please use Copy/Paste instead of retyping it. The typos you
might make by retyping can be confusing or even downright
misleading.
 
S

SharonInGa

YES! (thank you)

Marshall Barton said:
Use the Format function:

strMsg = "Annualized Return (" & me.Account & "," & Me.Date
& "): " & Format(rst.fields(0), "0.00") & "."

SHaron, in the future, when posting an expression or code,
please use Copy/Paste instead of retyping it. The typos you
might make by retyping can be confusing or even downright
misleading.
 

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

Top