A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Formatting for zero decimals



 
 
Thread Tools Display Modes
  #1  
Old August 7th, 2009, 11:36 PM posted to microsoft.public.access.reports
Don
external usenet poster
 
Posts: 992
Default Formatting for zero decimals

Hello, I'm using Access 2003 and trying to combine 2 fields, One value is
10000 and the other is bags and I want to display "10,000 bags"

I have put this into the code of the report but I still need to format the
value to not show decimal points, anyone know how to do this. Currently it
show "10,000.00 bags"
Me.txtFieldC = CStr(VBA.Format(Me.txtFieldA, "Standard")) & " " & Me.txtFieldB

Thanks
  #2  
Old August 8th, 2009, 04:18 AM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default Formatting for zero decimals

Try a text box with Control Source of:
=Format([txtFieldA], "#,##0") & " " & [txtFieldB]

IMHO, it would be much better to just display this, rather than to store it
in txtFieldC.

(Assumed the quantity will never be negative.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Don" wrote in message
news
Hello, I'm using Access 2003 and trying to combine 2 fields, One value is
10000 and the other is bags and I want to display "10,000 bags"

I have put this into the code of the report but I still need to format the
value to not show decimal points, anyone know how to do this. Currently it
show "10,000.00 bags"
Me.txtFieldC = CStr(VBA.Format(Me.txtFieldA, "Standard")) & " " &
Me.txtFieldB

Thanks


  #3  
Old August 10th, 2009, 03:43 PM posted to microsoft.public.access.reports
CraigH
external usenet poster
 
Posts: 50
Default Formatting for zero decimals

Inline

"Allen Browne" wrote:

Try a text box with Control Source of:
=Format([txtFieldA], "#,##0") & " " & [txtFieldB]

IMHO, it would be much better to just display this, rather than to store it
in txtFieldC.


He is displaying - (as far as what was written)

(Assumed the quantity will never be negative.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Don" wrote in message
news
Hello, I'm using Access 2003 and trying to combine 2 fields, One value is
10000 and the other is bags and I want to display "10,000 bags"

I have put this into the code of the report but I still need to format the


Report and not table.

value to not show decimal points, anyone know how to do this. Currently it
show "10,000.00 bags"
Me.txtFieldC = CStr(VBA.Format(Me.txtFieldA, "Standard")) & " " &
Me.txtFieldB


The txt should have been the clue - Usually txt goes in front of a text
box and not a field name.


Thanks



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.