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
@Reply 5 years 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
@Reply 5 years ago
Forgot to add ComboName.RowSource not just ComboName
Ray White
@Reply 5 years 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-BaghliOP
@Reply 5 years ago
Kindly can you show me how to do combobox as you type by MACRO and VBA
I will be appreciative
Adam Schwanz
@Reply 5 years 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-BaghliOP
@Reply 5 years 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
@Reply 5 years 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-BaghliOP
@Reply 5 years 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
@Reply 5 years ago
Clear the textbox in the OnCurrent event
TextBoxName = ""
Emad Al-BaghliOP
@Reply 5 years ago
Kevin
OnCurrent event on the form or in control?
Kevin Robertson
@Reply 5 years ago
OnCurrent is a form event
Emad Al-BaghliOP
@Reply 5 years 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
@Reply 5 years 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.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Search Seminar.