ACC2000: Combo Box Wizard Does Not Allow Selection of Table/QueryID: Q208807
|
When you select the Find a record on my form based on the value I selected in my combo box option in the Combo Box Wizard dialog box, the Combo Box Wizard does not give you the option to select a table or query as your data source.
When you select the option to find a record based on your selection in the combo box, the Combo Box Wizard uses the data from the RecordSource property of the form as the RowSource property for the combo box.
To work around this behavior, let the Combo Box Wizard build the combo box, and then, after the Combo Box Wizard finishes building the combo box, manually change the RowSource property of the combo box to the table or query that you want. For an example of how to do so, follow the steps in the "Steps to Reproduce Behavior" section later in this article.
Query: qryEmployeeList
-------------------------------------------
Type: Select Query
Field: EmployeeID
Table: Employees
Field: Name:[LastName] & ", " & [FirstName]
Table: Employees
Sort: Ascending
RowSourceType: Table/Query
RowSource: qryEmployeeList
ColumnCount: 2
ColumnWidths: 0";2"
BoundColumn: 1
Sub Combo43_AfterUpdate()
'Find the record that matches the control.
Me.RecordsetCone.FindFirst "[EmployeeID] = " & Me![Combo43]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
NOTE: Your Combo box control may have a name other than Combo43.
To further synchronize the form and combo box so that the combo box
always displays the name of the employee on the current record when
you scroll through the records, add the following code to the form's
OnCurrent property event procedure:
Private Sub Form_Current()
Me![Combo43] = Me![EmployeeID]
End Sub
where [Combo43] is the name of your combo box.For more information about combo boxes, click Microsoft Access Help on the
Help menu, type "Combo boxes: What they are and how they work." in the Office Assistant or the Answer Wizard,
and then click Search to view the topic.
Additional query words: prb
Keywords : kbdta FmsCmbob
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: May 13, 1999