473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Formatting Currency Values

The currency values are displayed in format of the regional settings specified in the computer of the user. I would like to display all the currency values in dollar format irrespective of the regional settings. i tried formatting the currency columns as $#.##0,00;($#.##0,00) but it still shows values in regional formats.
Is there a way to specify an application specific setting.
Jan 13 '10 #1
18 8050
MMcCarthy
14,534 Expert Mod 8TB
As far as I'm aware you can only set the custom format with the full stop as the decimal point and the comma as the thousand separator as follows:

$#,##0.00
Jan 13 '10 #2
NeoPa
32,556 Expert Mod 16PB
Exactly where and how did you try setting this currency format?

Everything I tried showed the values in dollars. My settings are set in standard British format with the £ (GBP) as the currency symbol.

PS. Though many European countries use the format you show (. & , reversed from the way used in Britain & America), this would be unusual for a display of dollars (I suppose it may be what they use in those countries when showing Dollars. I'm not really sure). I tested and I found my PC settings determined how each character is interpreted - regardless of where you put it in a format string. This doesn't look promising I'm afraid.
Jan 13 '10 #3
The format i specified has been set for all currencies in the tables.
When i view the data in table it show as dollars only but when i view the data in my reports the charts are taking up regional setting currency symbol which is GBP.
Jan 15 '10 #4
TheSmileyCoder
2,322 Expert Mod 2GB
If the reports were made before you added the formatting to the table, they wont "inherit" the format value. You can manually assign it in the report, by looking at the textbox's format property.
Jan 15 '10 #5
that also has $#.##0,00;($#.##0,00) set as its format
Jan 15 '10 #6
NeoPa
32,556 Expert Mod 16PB
I'm afraid I'm unable to reproduce what you describe Max. Even in a report. It always shows as dollars for me.
Jan 17 '10 #7
Do you think i need to code and set field format as $#.##0,00;($#.##0,00) on form load
Jan 18 '10 #8
TheSmileyCoder
2,322 Expert Mod 2GB
As far as I know, if you have set it correctly it should work.

If its still not working, then maybe you made a typo?

Is there any code attached to the field?
Jan 18 '10 #9
What is happening is there is pivot chart that has a query as a source. when i formatted the currency fields in the query to be displayed as dollars. after that when i saw the query result it is as expected.
When i see it on the pivot chart view inside a form its taking the regional setting format.
when i view the same as datasheet the values are formatted as $$$ as expected
Jan 18 '10 #10
TheSmileyCoder
2,322 Expert Mod 2GB
Wow you could have saved us all ALOT of trouble if you had specified it was within a chart. A chart is an object within access, with totally different behavior then a textbox for instance (who would have guessed....)

On your report open event have code like this, assuming your chart control is named ctrlChart:
Expand|Select|Wrap|Line Numbers
  1. ctrlChart.Axes(xlCategory).TickLabels.NumberFormat="$ #,##0.00"
You may need to exchanged xlCategory with xlValue depending on which axis your working on.

The easiest way to learn how to manipulate charts in Access is (IMO) to open Excel, create a similar chart, then start the Excel macrorecorder, do your changes, switch to VBA and view the code generated.
Jan 18 '10 #11
but there is no name set for the charts which are on their respective forms
Jan 18 '10 #12
TheSmileyCoder
2,322 Expert Mod 2GB
Be sure you have selected the chart object or "container" if you will, not the object inside the container. It will likely be named something like Chart1 or chartXX.

If you still are having trouble, Id suggest attaching your DB here and I or someone else can take a look at it.
Jan 18 '10 #13
Sample file is attached..Attachment 2634
Jan 18 '10 #14
TheSmileyCoder
2,322 Expert Mod 2GB
*DEEP DEEP SIGH*

I've spent nearly 2 hours now, and I give up. Ive found the property, and tried to set it at different points in the events (Like form load, form current, and the pivotchart events)

Sometimes I can set it, sometimes I can't.

When I CAN set it (Meaning I don't get an error), it has no real "Lasting" effect.
When I can't set it, I get a error saying cannot set this property during a event procedure (Such as the Pivotcharts Before_Render, After_Render, After_finalRender)
Expand|Select|Wrap|Line Numbers
  1. Me.Form.ChartSpace.charts(0).axes(1).Numberformat = "$ #,##0.00"
One thing I noticed, was that If I wrote:
Expand|Select|Wrap|Line Numbers
  1. Me.Form.ChartSpace.charts(0).axes(1).Numberformat = "'$' #,##0.00"
the formatting in the chart would look like 'kr' 25,000.00, the ['] would carry over to the formatting, but it would still go regional (kr is danish currency). Dunno if you can use that info for anything.


I did learn 1 thing from browsing the net for a solution, Variable watching. If/when it fails and you enter debug mode, you highlight the ChartSpace and press "Shift-F9" you can add a watch on that variable. Next time you load the form and it fails again, you can get alot of detailed information about the ChartSpace objects, and its exposed properties.(Cause the helpfile was non-existant on ChartSpace and ChartObject)

I hope you find a solution.
Jan 18 '10 #15
I tried to develop a chart using the wizard and i tried to set the format when i created the form, there is no way i could alter the format of the fields. it is still reverting back to the way it is. as u did i tried to code using the event, but i keep getting some error or the error. I have been stuck with this since friday.. All the time i saved in the save confirmation dialog is getting wasted here.
Jan 18 '10 #16
NeoPa
32,556 Expert Mod 16PB
Just as a tip, if you want the character value $ to appear, independently of it's expected effect as a currency indicator, you can use \$ (within a format string).
Jan 18 '10 #17
i tried format the fields with \$ but it still takes the regional settings
Jan 19 '10 #18
NeoPa
32,556 Expert Mod 16PB
I'm sorry. I wish I could help more (or even at all really), but I cannot reproduce your problem. It all seems to work for me (& I'm UK based so $ is not my default currency either). The only time I ever recall seeing something like this was in Excel, but I don't recall the details. I'm particularly surprised the \$ thing would be converted.
Jan 20 '10 #19

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Chad Z. Hower aka Kudzu | last post by:
I have a typed dataset that is on a WinForm and I have labels that have their text properties bound to fields in a data table. The values are of type decimal. When I dispaly them in the label, I...
16
by: Douglas | last post by:
Gday, How would I format a number so that: TheValue = 32500 Displays in the TextBox as: $32,500.00
6
by: Brad | last post by:
I guess I still have not grasped the logic of formatting a simple label or text box. Why would the following not work? I need the resulting label to display currency. lblAmtDue.Text =...
4
by: Mitchell Vincent | last post by:
How is everyone formatting currency with VB.NET? Before I was calling the API function for it, which took the currency symbol from the Windows settings. I've found this to be limited when...
2
by: Mitchell Vincent | last post by:
I have a bunch of text boxes and labels that hold currency values. I need some formatting on them, but since they are databound to a set, I'm confused as to how to do that. Do labels and text boxes...
14
by: Scott M. | last post by:
Ok, this is driving me nuts... I am using VS.NET 2003 and trying to take an item out of a row in a loosely-typed dataset and place it in a label as a currency. As it is now, I am getting my...
1
by: scoarescoare | last post by:
I am running into a problem that I cannot seem to solve. I'm using ADO.NET 2.0 with vb 2005. I have a dataset as a datasource that selects all of the Shoe_Types from a Shoe_Type table. I am...
1
by: jereesh | last post by:
Hi, I need to display formatted currency values in the My UI currency fields. I would like to know how to do currency formating in javascript . ie when I pass the value and the currency code it...
9
by: john coltrane | last post by:
Is there way to create a formatted string in a similar that is similar to sprintf? The same for printing, printf? C,D,E,F,G,N,X for currency, decimal, exponential, fixed, general, numerical,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.