update Combo/List box as you type

poporacer

Registered User.
Local time
Today, 11:20
Joined
Aug 30, 2007
Messages
136
I have a form that is bound to a table (tblAddress) and I want to be able to let the user type the last name in a textbox and then the ComboBox/List box would update as the user is typing. So if you typed in the letter R, then the combobox would list all last names that started with the letter R. Then if you typed the letter a, the combobox would reload with the last names that started with Ra, and so forth.

Any suggestion?

Thanks
 
It's not particularly hard. Use the change event of the textbox, remembering to use the .Text property, and set the rowsource of the combo/listbox to an SQL statement that uses Like, the current textbox value and a wildcard.
 
Not sure exactly how

Ok I have a form (frmSrchValidByName) and on this form I have a list box (lstSearch) and the textbox for the input is txtName. (should I use a combo box?) The query I have doesn't work and I am not sure how to add the wildcard (probably why the query doesn't work) In the On Change event of txtName I have- me.lstSearch.requery

The row source for lstSearch is:

SELECT tblValidate.ID, tblValidate.CDCID, tblValidate.LName, tblValidate.FName
FROM tblValidate
WHERE (((tblValidate.LName) Like "[Forms]![frmSrchValidByName]![txtName.text]"));

Thanks for the help
 
Try

Like [forms]![frmSrchValidByName].[txtName].[text] & "*"
 
make sure you use the requery action
 

Users who are viewing this thread

Back
Top Bottom