473,500 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Formating currency in a report with mils

I have data that I would like to format just so:

2000 to be $2,000
-2000 to be ($2,000)
2000.01 to be $2,000.01
2000.1234 to be $2,000.1234

The 'canned' Currency format type
[that comes with MS-Access 2002(10.3409.3601) SP-1]
*rounds* the fractions of a cent to the nearest cent.
I need to preserve the cents and fractions of cents,
only when they respectively exist.

My attempt at a custom format

$#,###.####;($#,###.####)
deals with the mils, but fails to
suppress the decimal point thusly

2000 becomes $2,000. not $2,000
-2000 becomes ($2,000.) not ($2,000)

I would like to suppress the decimal point
when the cents are zero.

1) Anybody know the solution to my specific problem?

2) Where is the *definitive* resource to learn about the
Format property in MS-Access reports? The {F1} help
file only brings up some abridged documentation, not
explaining all the intricacy.

Nov 13 '05 #1
2 1672
put you field as a text field and then you will be able to put a mask.

Nov 13 '05 #2

ug********@hotmail.com wrote:
put you field as a text field and then you will be able to put a

mask.

Thanks, I just tried using the mask property for my
textbox control, and I still failed trying to
supress the decimal point when I have fractions.
I also tried using the format() function, but still
needed something conditional. So...

I experimenting with another way, putting code in the onFormat
event of the Detail section of the report, I suceeded by using
this code:

===begin code===
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Int([price] * 10) = [price] * 10 _
Then ctlPrice.Format = "$#,###.00;($#,###.00);0" _
Else ctlPrice.Format = "$#,###.####;($#,###.####);0"
If Int([price]) = [price] Then ctlPrice.Format = "$#,###;($#,###);0"
End Sub
===end code===

Someone else might be able to code that more elegantly,
my self taught coding skills are crude, but it worked.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1237
by: Bill Partridge | last post by:
I am being very dumb... I am coverting an invoice value to a decimal and displaying the result on a VB.net 2003 form. However, I only want to display the result to 2 decimal places and I am...
2
9589
by: Dalan | last post by:
This should not be an issue, but it is. I'm sure that someone knows what little piece of code is needed too persuade Access 97 to include a currency format for labels (Avery, mailing type). Have...
5
7684
by: pelcovits | last post by:
How do I get Access to put a blank in a report column (but not eliminate the record completely), when the field in question is currency format, and the value is zero? My understanding is that null...
0
285
by: hallman | last post by:
I have data that I would like to format just so: 2000 to be $2,000 -2000 to be ($2,000) 2000.01 to be $2,000.01 2000.1234 to be $2,000.1234 The 'canned' Currency format type *rounds* the...
3
31940
by: Scott Gorman | last post by:
I have created a report in access. I had to add a text box to input a value for previous months balance. I have formatted to display with $ currency, and also with the " , " for thousand separator....
0
831
by: Akinyemi | last post by:
I am currently puting finishing touches to a Tax Computin Software. But I am worried about the number of decimal place the program displays - Four decimal place. And some of the fields display only...
1
1128
by: Ikraams | last post by:
I have two sheets (A3 size) reports. Both are same except the values in different currency. The other is paste link to the first. The problem is when I add text then have to maually adjust rows and...
9
1455
by: najmi | last post by:
hai guys...do you know how to formating the currency data from database into java form
4
3611
by: Paulo | last post by:
Hi, I need to show on a label the data coming from db and it must show a currency... I'm using a SqlDataReader reader, but doesnt work... lblPreco.Text = Eval(reader.ToString(), "{0:c}"); Can...
0
7136
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
7232
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...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.