Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 12-12-2018, 07:39 PM   #1
DataBass
Newly Registered User
 
Join Date: Jun 2018
Location: Downtown
Posts: 52
Thanks: 23
Thanked 0 Times in 0 Posts
DataBass is on a distinguished road
Controlling formatting and decimal places when combining text boxes

In the footer of a report, I have 3 text boxes, txtIncome, txtExpenses and txtPercent".

txtExpenses is a calculated control which refers to a text box in the detail section which gets its value from a subreport. It is formatted as currency, 2 decimal places

txtPercent= [txtExpenses]/[txtIncome]. It is formatted as percent, 1 decimal place.

I would like to combine txtExpenses and txtPercent into one box. I have done this by creating another text box with the following control source: =[txtExpenses] & " - " & [txtPercent]

However, in the new text box, the formatting is lost and the decimal places aren't consistent.

For example, instead of $2665.00 51.5%, I now get 2665 - 0.5157731759241
I have added the $ and % symbols but I don't know how to get the decimals correct.

Any suggestions?

DataBass is offline   Reply With Quote
Old 12-12-2018, 08:37 PM   #2
Galaxiom
Super Moderator
 
Join Date: Jan 2009
Location: NSW Australia
Posts: 11,340
Thanks: 83
Thanked 1,420 Times in 1,340 Posts
Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold
Re: Controlling formatting and decimal places when combining text boxes

Code:
= Format([txtExpenses], "$#,###.00") & " - " & Format([txtPercent], "#.#%")
Galaxiom is offline   Reply With Quote
The Following User Says Thank You to Galaxiom For This Useful Post:
DataBass (12-12-2018)
Old 12-12-2018, 08:51 PM   #3
DataBass
Newly Registered User
 
Join Date: Jun 2018
Location: Downtown
Posts: 52
Thanks: 23
Thanked 0 Times in 0 Posts
DataBass is on a distinguished road
Re: Controlling formatting and decimal places when combining text boxes

Pure genius. Thanks for that.

DataBass is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with formatting field as currency with no decimal places martinr General 2 01-09-2013 02:42 PM
convert long decimal number to 2 decimal places jammyp Reports 5 11-11-2011 06:49 AM
Formatting decimal places and numbers in result of a long query sonaljain123 Queries 7 07-13-2011 01:09 PM
Exporting as Text only 2 decimal places poet_will General 1 12-12-2005 01:21 PM
Round up decimal point to 4 decimal places sueviolet Queries 5 06-02-2005 11:30 AM




All times are GMT -8. The time now is 08:30 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World