ACC1x: Combo or List Box Column Not Formatted

Last reviewed: May 14, 1997
Article ID: Q106307
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SYMPTOMS

A column in a combo or list box displays information without the formatting you specified for the field in the underlying table or query.

CAUSE

Microsoft Access does not use the format specified in the Format property for a field in a table or query when the data is being displayed in a combo or list box. Information contained in a table field will be displayed with the default format for the data type when the data is being displayed in a combo or list box. For example, Date/Time fields will display with the General Date format, and numbers will display with the General Number format.

RESOLUTION

Base the combo or list box on a query, and format the field using the Format() function in a calculated query. The following example demonstrates how to use the Format() function in a query to format a field:

  1. Open the sample database NWIND.MDB.

  2. Create the following new query based on the Orders table:

          Query: Order Date Query
          -------------------------------------------------------------
    

          Type: Select Query
    
             Field: New Order Date: Format([Order Date], "Medium Date")
             Table: Orders
    
    

  3. Run the query. Note that the date is formatted with the Medium Date format.

  4. Save the query as Order Date Query, and then close the query.

  5. Create a new, blank, unbound form. Add a combo box with the following properties:

          Combo Box: Order Dates
          ---------------------------
    

          RowSourceType: Table/Query
          RowSource: Order Date Query
          ColumnCount: 1
    

  6. View the form in Form view.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database NWIND.MDB.

  2. Create the following new query based on the Orders table:

          Query: Order Date Query
          -----------------------
    

          Type: Select Query
          Field: Order Date
    
             Table: Orders
    
    

  3. Run the query. Note that the date is formatted with the Medium Date format.

  4. Save the query as Order Date Query, and then close the query.

  5. Create a new, blank, unbound form. Add a combo box with the following properties:

          Combo Box: Order Dates
          ---------------------------
          RowSourceType: Table/Query
          RowSource: Order Date Query
          ColumnCount: 1
    

  6. View the form in Form view.

Note that the date is displayed with the General Date format.

REFERENCES

Microsoft Access "User's Guide," version 1.0, pages 126-128

Microsoft Access "User's Guide," version 1.1, pages 130-132

Microsoft Access "Language Reference," version 1.0, pages 202-219


Additional query words: listbox combobox ADK
Keywords : FmsCmbo kbusage
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


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.