Results 1 to 11 of 11
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Following zeros (AXP)

    Hello All,
    I am trying to format a field on a standard form to display a number in this format; "100.00". Now, in the table the number is listed as 100. I have set the control on the form as fixed and decimal places as 2. Shouldn't the number be displayed as; "100.00"?

    Thanks,
    Mark

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

    Re: Following zeros (AXP)

    Are you sure it is a numeric field? If it is a text field containing numeric values, the Format property will be ignored.

    If it *is* a numeric field, try setting the Format property to 0.00 or #,##0.00 (the latter will display thousands separators if necessary).

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Following zeros (AXP)

    Hi Hans,
    Yes the value in the table is number field. The control gets populated with an after update event of a combo box. I ended up putting this in and it workds:
    Me.Text224.Value = Format(Me.GalvoHead.Column(4), "0.00")

    Thanks,
    Mark

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

    Re: Following zeros (AXP)

    Mark, the Format function will work fine if it is just for display purposes. Just be aware that the result is text which can't be used for calculations directly.

    I suspect that the cause of your problem is that even if the underlying data are numeric, a column in a combo box is just text.

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Following zeros (AXP)

    OK, so using the format function changes it to text?

    Thanks,
    Mark

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

    Re: Following zeros (AXP)

    According to the online help, the Format function returns a Variant (String).

  7. #7
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Following zeros (AXP)

    OK, so I stripped all of the formats off of the query (Combo box runs a query) and the number comes in but I cannot get it to display the trailing zeros. Problem 2: I cannot calculate based on this field. It is treating it as text. Got any ideas?

    Thanks,
    Mark

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

    Re: Following zeros (AXP)

    Does this work?

    Me.Text224.Value = CDbl(Me.GalvoHead.Column(4))

    Try setting the Format property of Text224 (not a good control name, by the way). If that doesn't work, delete Text224 and create it anew. I have seen controls that stubbornly refused to treat a value as numeric if they had been used for text before...

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Following zeros (AXP)

    Use the format property of the control on the form to set up a display format. That is not the same thing as using the Format function and it does not change the data type of the field.
    Charlotte

  10. #10
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Following zeros (AXP)

    OK,
    Hans,
    I haven't tried your last thing yet.

    Charlotte,
    I have the format on the control property set for Fixed, and decimal places 2.

    Thanks,
    Mark

  11. #11
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Following zeros (AXP)

    Hi Hans and Charlotte,
    That appears to work. It formats for display properly and now also calculates.

    Thank you again!,
    Mark

Posting Permissions

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