Link to home
Start Free TrialLog in
Avatar of Harry Batt
Harry Batt

asked on

VB Syntax Format Currency

Hello Experts,
I have a syntax question regarding the following line of code.  What I want to do is format the "TotalGifts" field referenced on a subform as currency.  Could someone help me rewrite it so that it works? The result should be Total Gifts: $(amount)
Thanks!

"Total Gifts: " & Forms![Main]![SubForm1].Form!subfrmGiftTotals.Form.[TotalGifts]
Avatar of Pratima
Pratima
Flag of India image

Hows you current output

"Total Gifts: " & Forms![Main]![SubForm1].Form!subfrmGiftTotals.Form.[TotalGifts]

I think like

Total Gifts: amount

you want to change it ot

Total Gifts: $(amount)

then tri this

"Total Gifts: $(" & Forms![Main]![SubForm1].Form!subfrmGiftTotals.Form.[TotalGifts] & ")"
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Harry Batt
Harry Batt

ASKER

Hi pratima

I did try that but don't want the "$" to appear if not necessary.  In another instance I used this format and I am looking for something similar.

"Payment Amount: " & Format(CCur(Me.PaymentAmount), "Currency")

Thanks
Hi DatabaseMX,
You nailed it.
Thanks for your help,
Harry