473,386 Members | 1,795 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.

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 1669
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
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
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
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
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
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
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
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
by: najmi | last post by:
hai guys...do you know how to formating the currency data from database into java form
4
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
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.