Microsoft KB Archive/106307

{|
 * width="100%"|

ACC1x: Combo or List Box Column Not Formatted

 * }

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:

 Open the sample database NWIND.MDB.  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  Run the query. Note that the date is formatted with the Medium Date format. Save the query as Order Date Query, and then close the query.  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  View the form in Form view.

STATUS
This problem no longer occurs in Microsoft Access version 2.0.

Steps to Reproduce Behavior
 Open the sample database NWIND.MDB.</li>  Create the following new query based on the Orders table:

<pre class="FIXEDTEXT">     Query: Order Date Query ---

Type: Select Query Field: Order Date Table: Orders </li> Run the query. Note that the date is formatted with the Medium Date format.</li> Save the query as Order Date Query, and then close the query.</li>  Create a new, blank, unbound form. Add a combo box with the following properties:

<pre class="FIXEDTEXT">     Combo Box: Order Dates ---     RowSourceType: Table/Query RowSource: Order Date Query ColumnCount: 1 </li> View the form in Form view.</li></ol>

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