ACC2: Combo Box Reference Returns Next Row If ColumnHeads = Yes

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

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

After you select an item in a combo box, a text box referencing the Column property of the combo box will display information from the next row.

CAUSE

This occurs if the ColumnHeads property of the combo box is set to Yes and the AfterUpdate event of the combo box performs a requery on this same combo box.

RESOLUTION

To work around this problem, do either of the following:

  • Set ColumnHeads property of the combo box to No.

    -or-

  • If possible, avoid the Requery action on the combo box.

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

  1. Open the sample database NWIND.mdb.

  2. Create a new, blank form in Design view.

  3. Add a combo box to the form, and set the following properties:

          Name: CtlEmployeesCmb
          RowSource: Employees
          ColumnCount: 3
          ColumnWidths: 1 in; 1 in; 1 in
          ColumnHeads: Yes
          BoundColumn: 1
    

  4. Set the AfterUpdate property of the combo box to the following [Event Procedure]:

          Sub CtlEmployeesCmb_AfterUpdate ()
             [CtlEmployeesCmb].Requery
          End Sub
    
    

  5. Add a text box to the form and set the following property:

          ControlSource: =[CtlEmployeesCmb].Column(2)
    

  6. View the form in Form view.

  7. Select an item in the combo box. Note that the text box displays the name of the employee in the next row down from the selected row.


Keywords : FmsCmbo kbusage
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbfix


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.