ACC2: Combo Box Column Property Returns Incorrect Information

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

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.

MORE INFORMATION

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.

  1. Start Microsoft Access and open the sample database NWIND.MDB.

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

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

  4. Change the AfterUpdate property to the following event procedure:

          Sub Customer_ID_AfterUpdate()
             MsgBox Me![Customer ID].Column(2)
          End Sub
    
    

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

  6. Type "Godos" (without quotation marks) in the Bill To box and then press ENTER. Note that the name "Peter Franken" is displayed, instead of the correct name.

REFERENCES

For more information about the Column property, search for "Column" then "Using the Column Property" using the Microsoft Access Help menu.


Keywords : FmsCmbo kbusage
Version : 2.0
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.