Mango1
07-31-2001, 06:20 AM
I have a form with a Combo Field that comes from a query. The Query contains several fields of which includes: Formal FullName, LastName. Within the form, the combo field is bound to Formal FullName. BUT, I'd like to be able to click on the field and type the last name or part of the last name to narrow down my search within the field. Then, once narrowed down, click the Formal FullName to enter it into the combo field. How can I do this?
Everton
07-31-2001, 08:01 AM
Hi,
Something like this might be what you're after, on the afterupdate event of the lastname control, change the rowsource of the formal fullname like this:
Me.[Formal FullName].Rowsource="Select * from [Query] where lastname=" & me.[lastname]
me.[Formal FullName].requery
HTH,
Paul.
Pat Hartman
07-31-2001, 11:22 AM
FormalFullName is a poor choice for a key. But in any event, as long as you have separate fields for FirstName, LastName, etc, you can build a combo that will work the way you want.
Create a query as follows:
Select FormalFullName, LastName & " " & FirstName As SearchName
From YourTable;
FormalFullName should still be the bound column, but SearchName should be the one shown in the combobox. Do this by setting the column widths property to 0;2". Make sure that eh column count is 2 and the bound column is 1. The default behaviour for combos is autoexpand, so as you type, the name starts filling in and the list scrolls.
Mango1
07-31-2001, 11:24 AM
appreciate all the help. Will try each to see which works best for me.