Webster's Dictionary: Help with a Combo Box

  • Thread starter Thread starter Rambo
  • Start date Start date
R

Rambo

Hi,

In my database I currently have a combo box designed to be a search box
for records on the form. It looks up customers last names. Currently
the search is working great, my only complaint is that after a customer
is selected from the drop down list I would like both last and first
name to be displayed in the combo box, instead of just last name as it
is currently. Does anybody know how to fix this? Does it have to do
with column widths? Thanks.

Sincerely,
Rambo
 
The RowSource of the combo defines what the columns are.
Change that query so it concatenates the 2 names into one.
You will end up with something like this:
SELECT [ClientID], [Surname] & ", " & [FirstName] AS FullName
FROM [Client] ORDER BY [Surname], [FirstName];

That's assuming the combo's other properties include:
Bound Column 1
Column Widths 0
Column Count 2
 
Hi Rambo,

This is actually pretty easy to fix.

You have two available methods. But, first, note that whatever is in
that first column is all that will be seen by the user when they leave
that field.

1) Concatonate (can't spell that) the last and first name in first
column of the text box so that a user sees "Johnson, Jason" instead of
just "Johnson". This allows them to search both last and first names,
since both will be seen in the combo box, and will mean that after the
user has left the combo box, both names will be seen there. Again, only
what is in the first column is what will be seen when they leave the
text box.

OR

2) Create an unbound text box next to the combo box. Set it equal to to
the two columns inside your combo box that show first and last name.
This would also need concatonated.

That's all! It's pretty easy. No, it has nothing to do with column
widths.
 
Dear Mr. Browne, Mr. Wickerath, and Ms. Amanda,

Thank you so very much for the wonderful advice. It has worked to
perfection.

Mr. Wickerath, your tutorial is very well designed and easy to follow.
I will certainly reference it in the future.

Sincerely,
 
Back
Top