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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Why wont this control show whole numbers?



 
 
Thread Tools Display Modes
  #1  
Old February 19th, 2010, 05:15 PM posted to microsoft.public.access.forms
TonyWilliams via AccessMonster.com
external usenet poster
 
Posts: 117
Default Why wont this control show whole numbers?

I have a control that is based on an expression in a query. This is the
expression:
txtaverage: IIf([txtNbrPartsOver1]=0,"0",[SumOftxtnbrparts]/[txtNbrPartsOver1]
)

I have set the format of the control to 0 decimal places but it still shows 2
decimal places not a whole number rounded.
What can I do to force a whole number?
Thanks
Tony

--
Why don't my grey cells communicate with each as fast as they used to? I hate
getting old!

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1

  #2  
Old February 19th, 2010, 06:21 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Why wont this control show whole numbers?

Tony -

You can round the anser as you calculate it:

txtaverage:
Round(IIf([txtNbrPartsOver1]=0,"0",[SumOftxtnbrparts]/[txtNbrPartsOver1]),0)

--
Daryl S


"TonyWilliams via AccessMonster.com" wrote:

I have a control that is based on an expression in a query. This is the
expression:
txtaverage: IIf([txtNbrPartsOver1]=0,"0",[SumOftxtnbrparts]/[txtNbrPartsOver1]
)

I have set the format of the control to 0 decimal places but it still shows 2
decimal places not a whole number rounded.
What can I do to force a whole number?
Thanks
Tony

--
Why don't my grey cells communicate with each as fast as they used to? I hate
getting old!

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1

.

  #3  
Old February 20th, 2010, 09:29 AM posted to microsoft.public.access.forms
TonyWilliams via AccessMonster.com
external usenet poster
 
Posts: 117
Default Why wont this control show whole numbers?

Thanks Daryl that worked just fine.
Tony

Daryl S wrote:
Tony -

You can round the anser as you calculate it:

txtaverage:
Round(IIf([txtNbrPartsOver1]=0,"0",[SumOftxtnbrparts]/[txtNbrPartsOver1]),0)

I have a control that is based on an expression in a query. This is the
expression:

[quoted text clipped - 6 lines]
Thanks
Tony


--
Why don't my grey cells communicate with each as fast as they used to? I hate
getting old!

Message posted via http://www.accessmonster.com

  #4  
Old March 20th, 2010, 09:53 PM posted to microsoft.public.access.forms
love[_3_]
external usenet poster
 
Posts: 10
Default Why wont this control show whole numbers?


"TonyWilliams via AccessMonster.com" u56994@uwe wrote in message
news:a3e015cb5403b@uwe...
I have a control that is based on an expression in a query. This is the
expression:
txtaverage:
IIf([txtNbrPartsOver1]=0,"0",[SumOftxtnbrparts]/[txtNbrPartsOver1]
)

I have set the format of the control to 0 decimal places but it still
shows 2
decimal places not a whole number rounded.
What can I do to force a whole number?
Thanks
Tony

--
Why don't my grey cells communicate with each as fast as they used to? I
hate
getting old!

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1


  #5  
Old March 23rd, 2010, 09:12 PM posted to microsoft.public.access.forms
love[_3_]
external usenet poster
 
Posts: 10
Default Why wont this control show whole numbers?


"TonyWilliams via AccessMonster.com" u56994@uwe wrote in message
news:a3e015cb5403b@uwe...
I have a control that is based on an expression in a query. This is the
expression:
txtaverage:
IIf([txtNbrPartsOver1]=0,"0",[SumOftxtnbrparts]/[txtNbrPartsOver1]
)

I have set the format of the control to 0 decimal places but it still
shows 2
decimal places not a whole number rounded.
What can I do to force a whole number?
Thanks
Tony

--
Why don't my grey cells communicate with each as fast as they used to? I
hate
getting old!

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1


  #6  
Old March 23rd, 2010, 09:31 PM posted to microsoft.public.access.forms
love[_3_]
external usenet poster
 
Posts: 10
Default Why wont this control show whole numbers?


"TonyWilliams via AccessMonster.com" u56994@uwe wrote in message
news:a3e015cb5403b@uwe...
I have a control that is based on an expression in a query. This is the
expression:
txtaverage:
IIf([txtNbrPartsOver1]=0,"0",[SumOftxtnbrparts]/[txtNbrPartsOver1]
)

I have set the format of the control to 0 decimal places but it still
shows 2
decimal places not a whole number rounded.
What can I do to force a whole number?
Thanks
Tony

--
Why don't my grey cells communicate with each as fast as they used to? I
hate
getting old!

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1


 




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 01:51 AM.


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