Combo box to find records

M

Michaelchessking

Hi, need help with what I am sure is a simple problem.

I have a form and wish to find records using a combo box. Which I know how
to do. The problem is it takes me to "one" record. I would like to select,
for example, employee name: John Smith and it return all records for John
Smith while filtering out all other records.

I would be thankful for any help.

Thanks,
Michael
 
J

John W. Vinson

Hi, need help with what I am sure is a simple problem.

I have a form and wish to find records using a combo box. Which I know how
to do. The problem is it takes me to "one" record. I would like to select,
for example, employee name: John Smith and it return all records for John
Smith while filtering out all other records.

I would be thankful for any help.

Thanks,
Michael

Try setting the Form's Filter property. Since you don't name the combo box, or
give us any indication of your tablenames or fieldnames it's a bit hard to be
specific, but try something like this in the combo box's AfterUpdate event:

Private Sub cboMyCombo_AfterUpdate()
Me.Filter = "[EmployeeID] = " & Me!cboMyCombo
Me.FilterOn = True
End Sub


John W. Vinson [MVP]
 

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