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

ID: Q154141


The information in this article applies to:
  • Microsoft Access 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.


Additional query words:

Keywords : kbusage FmsCmbo
Version : 2.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: December 2, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.