Listbox Select

  • Thread starter Thread starter Bret
  • Start date Start date
B

Bret

I have a list box with a table of Employee ID and Employee names as its
recordsource.
Please I'm looking for code that will do the following:
* User enters an Employee ID in a text box I've placed above the list box.
* When user hits ENTER key, the Employee ID is found in the list box and
that record is Selected.
* I'll be using the "After Update" event for the text box.

thanks for any assistance
 
Why are you using a text box and a list box?
Guess why a Combo Box is called a Combo box. It is a combination of a text
box (the part the always displays) and a list box (the drop down part)

I suggest you use a combo box.
To navigate to the employee's record, use the After Update event of the combo:

With Me.RecordsetClone
.FindFirst "[Employee ID] = " & Me.cboEmployee
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
 
Bret said:
I have a list box with a table of Employee ID and Employee names as its
recordsource.
Please I'm looking for code that will do the following:
* User enters an Employee ID in a text box I've placed above the list box.
* When user hits ENTER key, the Employee ID is found in the list box and
that record is Selected.
* I'll be using the "After Update" event for the text box.

thanks for any assistance

Me.ListboxName.Value = Me.TextboxName.Value
 
Back
Top