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  

Adding controls



 
 
Thread Tools Display Modes
  #1  
Old July 5th, 2006, 01:59 PM posted to microsoft.public.access.forms
Tony Williams
external usenet poster
 
Posts: 349
Default Adding controls

Is there a way that I can have a calculated control that adds two numerical
figures with 3 decimal places but displays the answer as a whole number. In
other words I want the calculation to take into account the decimals but not
display the decimals on my form. I've tried setting the format to 0 decimals
places but that seems to ignore the decimals in my calculation.
Thanks
Tony


  #2  
Old July 5th, 2006, 03:42 PM posted to microsoft.public.access.forms
Jeff L
external usenet poster
 
Posts: 448
Default Adding controls

Try =Int([Field1] + [Field2])

  #3  
Old July 5th, 2006, 03:48 PM posted to microsoft.public.access.forms
Douglas J Steele
external usenet poster
 
Posts: 415
Default Adding controls

In case any of the fields are Null, it would be better to use:

=Int(Nz([Field1],0) + Nz([Field2],0))

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Jeff L" wrote in message
ups.com...
Try =Int([Field1] + [Field2])



  #4  
Old July 5th, 2006, 03:57 PM posted to microsoft.public.access.forms
Tony Williams
external usenet poster
 
Posts: 349
Default Adding controls

Thanks for that BUT doesn't INT just drop off the decimal points without any
rounding?
Tony
"Douglas J Steele" wrote in message
...
In case any of the fields are Null, it would be better to use:

=Int(Nz([Field1],0) + Nz([Field2],0))

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Jeff L" wrote in message
ups.com...
Try =Int([Field1] + [Field2])





  #5  
Old July 5th, 2006, 04:05 PM posted to microsoft.public.access.forms
Tony Williams
external usenet poster
 
Posts: 349
Default Adding controls

For eg 4.6 and 5.6 formatted as 0 decimals gives 5 and 6 , total 11 but Int
(4.6+5.6) gives 10?
I want 4.6 + 5.6 to give me 10. Is that possible?
I know this is a strange request but I do have a good reason for wanting to
do this.
Thanks
Tony
"Douglas J Steele" wrote in message
...
In case any of the fields are Null, it would be better to use:

=Int(Nz([Field1],0) + Nz([Field2],0))

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Jeff L" wrote in message
ups.com...
Try =Int([Field1] + [Field2])





  #6  
Old July 5th, 2006, 04:06 PM posted to microsoft.public.access.forms
Douglas J Steele
external usenet poster
 
Posts: 415
Default Adding controls

True. You may want to use the Round function (but be aware that it uses
Banker's Rounding: .5 will always be rounded to the nearest even number,
whether that's up or down.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Tony Williams" wrote in message
...
Thanks for that BUT doesn't INT just drop off the decimal points without

any
rounding?
Tony
"Douglas J Steele" wrote in message
...
In case any of the fields are Null, it would be better to use:

=Int(Nz([Field1],0) + Nz([Field2],0))

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Jeff L" wrote in message
ups.com...
Try =Int([Field1] + [Field2])







  #7  
Old July 5th, 2006, 08:00 PM posted to microsoft.public.access.forms
Tony Williams
external usenet poster
 
Posts: 349
Default Adding controls

Found a solution in a "fix" of a formula using an IIf statement
Thanks
Tony
"Tony Williams" wrote in message
...
For eg 4.6 and 5.6 formatted as 0 decimals gives 5 and 6 , total 11 but
Int (4.6+5.6) gives 10?
I want 4.6 + 5.6 to give me 10. Is that possible?
I know this is a strange request but I do have a good reason for wanting
to do this.
Thanks
Tony
"Douglas J Steele" wrote in message
...
In case any of the fields are Null, it would be better to use:

=Int(Nz([Field1],0) + Nz([Field2],0))

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Jeff L" wrote in message
ups.com...
Try =Int([Field1] + [Field2])







 




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 09:00 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.