Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 517
  • Last Modified:

FormatCurrency()

This function is listed with the other Format(), but when I try to use the FormatCurrency in a Query, or Report I get only errors, as though it does not recognize this Function. Is this documented  somewhere? What's up with the FormatCurrency?
0
eeevbeee
Asked:
eeevbeee
1 Solution
 
nico5038Commented:
Just type the command under VBA and press F1 for the syntax.

The query indeed doesn't accept the function. (Guess M$ made a mistake)

I used a workaroud by creating a function in the modules section like:

Function fncFormatcurrency(strCurr As Currency)

fncFormatcurrency = FormatCurrency(strCurr, 2)

End Function

And the query:

SELECT fncFormatcurrency([UnitPrice]) AS Pr
FROM Products;

What will supply the wanted format.....

Nic;o)
0
 
Ryan ChongCommented:
or you can directly using Format like this to show Currency in Format you want:

SELECT Format([UnitPrice],"##,##0.00") AS Pr
FROM Products;
0
 
samphiCommented:
You can use CCur...

"Where salary = ccur(""" & Format$(MyCurrencyValue) & """)"

That use the "regional setting"

Good Luck!
Phil.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now