Auto expand not working with comma

J

Jeff

I have a combobox that auto fills the client name as I type, although the
combo box's row source is

SELECT DISTINCTROW Clients.ClientID, [ClientLastName] & ", " &
[ClientFirstName] AS ClientLastandFirst FROM Clients ORDER BY
[ClientLastName] & ", " & [ClientFirstName];

This conveniently shows the whole name first and last. As I start to type
the last name everything works OK but as soon as I type the comma the
expanding (auto fill) stops working. Also if I continue and type the full
name and hit return I get a message that the name is not on the list! Any
Ideas on how to make this work?
 
A

Allen Browne

You RowSource is placing TWO spaces between the last name and first name.
Are you sure you are typing 2 spaces when you try to get a match?

In any case, change the ORDER BY clause to just:
[ClientLastName], [ClientFirstName];
That allows Access to use any indexes on the fields.
 
J

Jeff

Two spaces!.....I feel dumb...simple mistake but I just needed another pair
of eyes to see it. Thank you


Allen Browne said:
You RowSource is placing TWO spaces between the last name and first name.
Are you sure you are typing 2 spaces when you try to get a match?

In any case, change the ORDER BY clause to just:
[ClientLastName], [ClientFirstName];
That allows Access to use any indexes on the fields.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jeff said:
I have a combobox that auto fills the client name as I type, although the
combo box's row source is

SELECT DISTINCTROW Clients.ClientID, [ClientLastName] & ", " &
[ClientFirstName] AS ClientLastandFirst FROM Clients ORDER BY
[ClientLastName] & ", " & [ClientFirstName];

This conveniently shows the whole name first and last. As I start to type
the last name everything works OK but as soon as I type the comma the
expanding (auto fill) stops working. Also if I continue and type the full
name and hit return I get a message that the name is not on the list! Any
Ideas on how to make this work?
 

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