ACC2: How to Format Data in Combo Boxes and List Boxes

Last reviewed: May 14, 1997
Article ID: Q120904
The information in this article applies to:
  • Microsoft Access version 2.0

SUMMARY

Novice: Requires knowledge of the user interface on single-user computers.

Microsoft Access displays data in list boxes and combo boxes whose RowSource property is set to a table or query using the format defined in the underlying fields' Format property.

If you want the data in a list box or combo box to be displayed with a different format, you can create a query and set the fields' formats using the query's Format property, or you can use the Format() function in an expression.

If a list box or combo box's RowSource property is set to an SQL statement, a field's Format property will have no affect on how the data is displayed, because SQL statements do not contain or specify any formatting information.

NOTE: In version 7.0, combo boxes have a Format property.

MORE INFORMATION

To change the format for a field in a query, follow these steps:

  1. Select the field in the query grid.

  2. From the View menu, choose Properties.

  3. Select one of the predefined formats in the Format property box, or enter an expression to format the field.

  4. Close the property sheet.

The following are examples of expressions for formatting fields in a query:
  • The expression

          format([MyDate],"dddd mmmm d, yyyy")
    

    will display the date 1/1/94 as:

          Saturday January 1, 1994
    
  • The expression

          format([MyNumber],"$#,##0;($#,##0)")
    

    will display the number 1256 as

          $1,256
    

    and will display the number -1256 as:

          ($1,256)
    

REFERENCES

For more information about formatting data, search for "Format," and then "Formatting a Field" using the Microsoft Access Help menu.


Keywords : FmsCmbo kbusage
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.