Listbox Select

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
 
K

Klatuu

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
 
S

Stuart McCall

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top