Combo Box to find values in multiple columns

C

CBiesold

My db has customer info, ie names, addresses, phone #s, etc. I have a
combo box in which the user can input the last name (or first few
letters of last name) and the correct record will be displayed. I am
trying to create the same thing for the phone # columns What I have
works for 1 column (home) but if the inputed # is in the cell or work
fields, I get an error "the text you entered isn't an item in the list.
Select an item from the list, or enter text that matches one of the
listed items." It seems like a very simple request, to have the combo
box search all 4 columns (home, work, mobile, mobile1).

My form has no macros or queries. Just 2 tables & 2 forms (One to Many
relationship linked by ID).

RowSource for the Combo box is: SELECT [Frequent Flyer T].ID, [Frequent
Flyer T].Home, [Frequent Flyer T].Work, [Frequent Flyer T].Mobile,
[Frequent Flyer T].Mobile1 FROM [Frequent Flyer T];

AfterUpdate:
Private Sub Combo25_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo25], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

I don't know how to write code or create expressions, etc. Can anyone
help me? Is this just a setting that I can't find?

Thank You So Much!
Charis
 
D

Douglas J Steele

AFAIK, you can't make a combo box match what you're typing in the text box
portion to any other column than the first.

While it might be possible to put code in the combo box's KeyDown event, I
don't think it would be particularly useful to your user, since all they'll
see in the combo box's text box is the first column anyhow.
 

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