Microsoft KB Archive/121455

= ACC2: Combo Box Column Property Returns Incorrect Information =

Article ID: 121455

Article Last Modified on 11/6/2000

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q121455





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

When you select a value in a combo box and then type over the selected value, the Column property returns information from the wrong row.



CAUSE
The correct information is not available for the Column property until after the AfterUpdate event occurs.



RESOLUTION
There are four ways to work around this problem:


 * Use the Requery method on the AfterUpdate property of the combo box to rebuild the list. If there are not many items in the combo box, this method is usually fastest.
 * Use the Recalc method on the AfterUpdate property of the combo box to update the list data. If there are not many calculated controls, this method is often faster than the Requery method.
 * Use a list box instead of a combo box to display the data.
 * Select the value in the combo box instead of typing the value.



STATUS
Microsoft has confirmed this to be a problem in Microsoft Access version 2.0. This problem no longer occurs in Microsoft Access version 7.0.



Steps to Reproduce Problem
CAUTION: Following the steps in this example will modify the sample database NWIND.MDB. You may want to back up the NWIND.MDB file, or perform these steps on a copy of the NWIND database.

 Start Microsoft Access and open the sample database NWIND.MDB. Open the Customer List query in Design view and drag the Contact Name field from the field list to the query grid. Save and then close the query.  Open the Orders form in Design view and change the following properties for the Customer ID combo box:

     ColumnCount: 3 ColumnnWidths: 2;0;2 ListWidth: 4   Change the AfterUpdate property to the following event procedure:

Sub Customer_ID_AfterUpdate MsgBox Me![Customer ID].Column(2) End Sub </li> View the form in Form view and select Frankenversand in the Bill To box. Note that the name "Peter Franken" is displayed as it should be.</li> Type Godos in the Bill To box and then press ENTER. Note that the name "Peter Franken" is displayed, instead of the correct name.</li></ol>

<div class="references_section">