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.
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".
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.