Solved

How to output a number in standard format while the number is varying in value

Posted on 2008-06-15
2
235 Views
Last Modified: 2013-11-27
I want to write some code like this:
sSQL = "SELECT Format([OrderValue],'0,000.00') As Expr1 FROM..."
then open a recordset to write this value into a Word document.
The problem here is the value of OrderValue changes everytime.
If OrderValue = 500, in Word doc it will be 0,500.00 (extra 0 and comma)
If OrderValue = 4000000, in Word doc it will be 4000,000.00 (lack of one comma)
How to solve such problem?
0
Comment
Question by:angie_angie
2 Comments
 
LVL 6

Accepted Solution

by:
psychic_zero earned 500 total points
ID: 21791049
I expect you're using MS Access database. Maybe you can change 0 with # like this and see is it works:

sSQL = "SELECT Format([OrderValue],'#,###,###.00') As Expr1 FROM..."
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21791084
angie_angie,

<open a recordset to write this value into a Word document>
If you just need to insert this value into a Word Document you can just store it as a Variable and insert it into the text.
Please explain why it must be in a recorrdset to be inserted into a Word Document?

JeffCoachman
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now