Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264

    Unanswered: Formatting in a calculated field

    I would like to format some numbers that are in a calculated field. I am doing the following:

    format(<fieldName>,"standard") which is ok for some of the fields but I also need one that will force zero decimal places. How can I incorporate that into the statement?

    The format that I want is #,### with no decimals. I cannot determine the number of digits before they are calculated.

    The other aspect of this question is how to get the formatting to display. Some of the calculated fields are in the data source for a subform. The calculated fields do not show with formatting. They are formatted in the calculation and the text box on the form but they do not display that way.

    Thanks.
    Last edited by sps; 09-01-04 at 11:02.

    Steve

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    Where are they calculated? In a form or report? If so then do the calculation in the text box but use the Format property of the text box for the formatting. You can use this with the Decimal Places property to get the results you want. I would also say that this should work with the subform.

    The other choice is to use format and "#,###" instead of "Standard".

    Format(<fieldName>,"#,###")

  3. #3
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    They are actually calculated in a query that is used as a data source for a form.

    The #,### method solves the decimal point issue but they still do not show up in the form in the proper format

    Steve

  4. #4
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    Are you combining fields? If not then the form should be used to format the number. Use the Format property of the text box that data is bound to. Another option, assuming the data doesn't need to change, is to convert the number to text. As text Access could not change the way the data is displayed. Use CStr to convert it to a string. I wouldn't suggest this solution though. If you gave us more information about what you are trying to do then mayb someone can give you more specific advise.

Posting Permissions

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