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  

Formating decimal places in an unbound field



 
 
Thread Tools Display Modes
  #1  
Old November 1st, 2006, 02:21 PM posted to microsoft.public.access.reports
Alex
external usenet poster
 
Posts: 40
Default Formating decimal places in an unbound field

Hi, I have an unvound control which contains some text as well as the
following code:
& [Score]*100/[MaxMarks] & "
How do I restrict the calculation above to 0 places of decimal. i tried
setting the control properties, but that seems to have no effect

Thanks
A


  #2  
Old November 1st, 2006, 02:28 PM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default Formating decimal places in an unbound field

Set the Format to Fixed, as well as Decimal Places to 0.

--
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.

"Alex" wrote in message
...
Hi, I have an unvound control which contains some text as well as the
following code:
& [Score]*100/[MaxMarks] & "
How do I restrict the calculation above to 0 places of decimal. i tried
setting the control properties, but that seems to have no effect

Thanks
A



  #3  
Old November 1st, 2006, 02:29 PM posted to microsoft.public.access.reports
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default Formating decimal places in an unbound field

hi Alex,

Alex wrote:
Hi, I have an unvound control which contains some text as well as the
following code:
& [Score]*100/[MaxMarks] & "
How do I restrict the calculation above to 0 places of decimal. i tried
setting the control properties, but that seems to have no effect

Of course, as a string can't be formatted.

Use the CInt(), Int() or Fix() function, e.g.
CInt([Score]*100/[MaxMarks]).


mfG
-- stefan --
  #4  
Old November 1st, 2006, 03:10 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Formating decimal places in an unbound field

Alex wrote:

Hi, I have an unvound control which contains some text as well as the
following code:
& [Score]*100/[MaxMarks] & "
How do I restrict the calculation above to 0 places of decimal. i tried
setting the control properties, but that seems to have no effect



Use the Format function to get whatever formatting you want:

.... & Format(Score*100/MaxMarks, "#,##0") & ...

--
Marsh
MVP [MS Access]
  #5  
Old November 1st, 2006, 09:56 PM posted to microsoft.public.access.reports
Alex
external usenet poster
 
Posts: 19
Default Formating decimal places in an unbound field

Thanks All

A

"Alex" wrote in message
...
Hi, I have an unvound control which contains some text as well as the
following code:
& [Score]*100/[MaxMarks] & "
How do I restrict the calculation above to 0 places of decimal. i tried
setting the control properties, but that seems to have no effect

Thanks
A




 




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 04:49 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.