Results 1 to 13 of 13
  1. #1
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    number properites (2000)

    I need help setting the properties of a text box. I have the text box writing to a field that is a number. I have the field properties set to integer, 1 decimal place. When the user inputs 2.0, I want the zero to appear. Right now, it suppresses the zero. What setting to I need to change so that the zero appears? Also, I don't want it to round when I put in 2.3 for example. I want the decimal to appear. Right now it rounds. How do I change this?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: number properites (2000)

    Integer type is a whole number. You can't store decimal in it.
    Change the type of the field in the table to single.
    Francois

  3. #3
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: number properites (2000)

    I guess my brain quit working. I don't know what I thought I could store a decimal as an integer.
    How do I get it to display the .0?

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: number properites (2000)

    If you use a format function like for sample #.0 it will display the 0 but this 0 is of no meaning.
    Francois

  5. #5
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: number properites (2000)

    Thanks,
    I realize it is of no meaning, but the request asked to display the zero. I don't really know why.

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: number properites (2000)

    The fact that you set the decimal places to 1 will give you one decimal in some of the predefined format function (Standard, Fixed, Currency, Euro)
    Francois

  7. #7
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: number properites (2000)

    In a different text box, I have =NZ([txtMR])+NZ([txtTUR])+NZ([txtWR])+NZ([txtTHR])+NZ([txtFR])+NZ([txtSAR])+NZ([txtSUR]). I only want to display a total if there is something entered in one of the text boxes. How can I make the zero that appears in this text box be null?

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: number properites (2000)

    Try this:
    =Iif(NZ([txtMR])+NZ([txtTUR])+NZ([txtWR])+NZ([txtTHR])+NZ([txtFR])+NZ([txtSAR])+NZ([txtSUR])=0,Null,NZ([txtMR])+NZ([txtTUR])+NZ([txtWR])+NZ([txtTHR])+NZ([txtFR])+NZ([txtSAR])+NZ([txtSUR]))

  9. #9
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: number properites (2000)

    Pat, that works great. What exactly is that statement doing?

  10. #10
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: number properites (2000)

    =Iif(NZ([txtMR])+NZ([txtTUR])+NZ([txtWR])+NZ([txtTHR])+NZ([txtFR])+NZ([txtSAR])+NZ([txtSUR])=0,Null,NZ([txtMR])+NZ([txtTUR])+NZ([txtWR])+NZ([txtTHR])+NZ([txtFR])+NZ([txtSAR])+NZ([txtSUR]))
    What this statement does is to test if your expression is equal, and if so, show a Null value, else show your expression.

  11. #11
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: number properites (2000)

    That helps tremendously!!!

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: number properites (2000)

    Another possibility would be to keep the Control Source as =NZ([txtMR])+NZ([txtTUR])+NZ([txtWR])+NZ([txtTHR])+NZ([txtFR])+NZ([txtSAR])+NZ([txtSUR]) and set the Format property to

    #.0;-#.0;""

    This custom format consists of three parts: the first is for positive values, the second for negative values and the third for zero values. Since the third part is an empty string "", zeros will not be displayed.

  13. #13
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: number properites (2000)

    Up there for thinking Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •