Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter a combobox value list by textbox

Status
Not open for further replies.

MA04

Technical User
Dec 21, 2004
162
GB
Hi all,

I needed to filter a combobox value list by a user entry in a textbox, like the way when a user enters values in the combobox which filters through the value list by the user entry. Also noting that the user does not need to enter the full value like a wildcard entry.

Thanks in advance for any help,
M-.
 
In the AfterUpdate event procedure of the textbox rebuild the RowSource property of the combobox:
Me![combo name].RowSource = "SELECT .... WHERE somefield Like [tt]'"[/tt] & Trim(Me![textbox name] & "") & [tt]"*'"[/tt]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PHV,

Thansk for the reply, i have a slight syntax error with my while statement at the moment the error is a missing operator but can't seem to spot were it is:

Code:
"WHERE (((Field1)='" & Forms![formname]![Field1criteria] & ")' AND ((Field2)= Like '" & Trim(Me![Txtboxforfield2] & "") & "*'))"

Thanks in advance for any help
M-.
 
Code:
"WHERE Field1='" & Forms![formname]![Field1criteria] & "' AND Field2 Like '" & Trim(Me![Txtboxforfield2] & "") & "*'"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top