Microsoft KB Archive/154141

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

Article ID: 154141

Article Last Modified on 7/5/2002

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q154141



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



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



Steps To Reproduce Problem
 Open the sample database NWIND.mdb. Create a new, blank form in Design view. 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

  Set the AfterUpdate property of the combo box to the following [Event Procedure]: Sub CtlEmployeesCmb_AfterUpdate [CtlEmployeesCmb].Requery End Sub  Add a text box to the form and set the following property:

ControlSource: =[CtlEmployeesCmb].Column(2)

</li> View the form in Form view.</li> 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.</li></ol>

Keywords: kbbug kbfix kbusage KB154141

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.