text box filter combo boxUpload ImagesLink Emad Al-Baghli 13 months ago
Hi, I have combo box a lot of Names and I want to put text box next to it that if I type any letter in the text box it will filter this combo box to make it faster to pick
kindly, can you change my name to "EMD" I do not want my full name show up :) in forums and conversations public plz
Adam Schwanz 13 months ago
What you need to do is make an after update event in your text box to set the row source of your combo box. Then use the WHERE to filter based on your text box. Something like
ComboName = "SELECT ID From TableT WHERE ID Like """ & TextBoxName & "*"""
Adam Schwanz 13 months ago
Forgot to add ComboName.RowSource not just ComboName
Ray White 13 months ago
In the Combo Box just use the search as you type code.
That way the Combo Box will not start loading any records until you start typing
Richard shows how to do that somewhere in here.
Emad Al-Baghli 13 months ago
Kindly can you show me how to do combobox as you type by MACRO and VBA
I will be appreciative
Adam Schwanz 13 months ago
The search as you type is almost identical to what I just told you as long as it's only one field you're sorting by.
This has the search as you type lessons = https://599cd.com/site/courselist/seminars/access-search/
No idea how you'd do it with a macro and I don't even want to try LOL. VBA much easier.
Emad Al-Baghli 13 months ago
Mr.Adam,
I am enrolled to Access Search Seminars, what is the lesson number?
Because my VBA at my work is blocked for security reasons, that is why if you kindly give it a try by MACRO I will be appreciated
Adam Schwanz 13 months ago
I think it's lesson 33. Search as you Type. You can try to mimic that into a macro or maybe Rick knows a way but I don't know very much about macros. I ditched them the instant I learned VBA.
Emad Al-Baghli 13 months ago
I did it!
I have text box next to combobox and I go to the combobox query design I put the path that linked to textbox, and if I write something in text box it will filter the combobox,
but the problem is if I hit new record any thing I type still remain in text box how can I say to Access clear textbox after hit add new record or go to next record?
Kevin Robertson 13 months ago
Clear the textbox in the OnCurrent event
TextBoxName = ""
Emad Al-Baghli 13 months ago
Kevin
OnCurrent event on the form or in control?
Kevin Robertson 13 months ago
OnCurrent is a form event
Emad Al-Baghli 13 months ago
Kevin,
I go to the Form,OnCurrent Event, Macro, and I chose SetProperty, Control Name, Property Value, Value=""
I put it in Expression Builder same issue =[Searcا1]=""
I could not use VBA becuse it is blocked at work, I can use only Macro,Expression builder, and Query
but it does not work, also in Same form I have more that one control with same job for filtering
Kindly can you explain it more to me
Kevin Robertson 13 months ago
In the Macro Builder:
- Click in the Show All Actions button on the ribbon
- Choose SetValue
Item = TextboxName
Expression = ""
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.