473,624 Members | 2,119 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.36 01) 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 1686
put you field as a text field and then you will be able to put a mask.

Nov 13 '05 #2

ug********@hotm ail.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(C ancel 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
1251
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 struggling to it - sorry for such an easy question! Can somebody advice me how to achieve this? -- Thanks
2
9599
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 had no problems with currency formatting on reports - just the labels. Doesn't matter if the associated field in the Table and Form have Format as Currency, because on the labels (for instance $50.00) prints as: 50 The only way to get it to print...
5
7709
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 is not permitted as a currency value. thanks
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 fractions of a cent to the nearest cent.
3
31970
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. I have not been able to get it to display correctly. It is just the numbers without the formatting. Please help !!! *** Sent via Developersdex http://www.developersdex.com ***
0
836
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 one decimal place while some do not at all! The program has Basic Salary, Housing Allowance ..., Gross Pay , Reliefs, Taxable Pay, Annual Tax payable, and Monthly Tax Payable fields. I declared all the variables As Currency. I want the program...
1
1140
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 collumn in the second sheet. Is there a way even the formating will change in second sheet simultaneously like the cell values?
9
1460
by: najmi | last post by:
hai guys...do you know how to formating the currency data from database into java form
4
3629
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 you help me ? Thanks! VS 2005 asp.net C# 2.0
0
8234
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8172
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8677
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8620
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7158
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5563
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.