search for a part of a field in a combobox in a subform

User avatar
tknijnenburg
NewLounger
Posts: 10
Joined: 30 Jun 2015, 11:46
Location: The Hague

search for a part of a field in a combobox in a subform

Post by tknijnenburg »

Hi All,

I have a form wtih a subform.
In the subform is a combobox where I can select the whole description.
Is it possible to seach for a part of the the description?
You do not have the required permissions to view the files attached to this post.
Grtz, Ton

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: search for a part of a field in a combobox in a subform

Post by HansV »

Your code refers to a combo box named cboFilter but the form doesn't contain any combo box.
You also call a procedure named btnZoek, but there is no such procedure.

Did you strip down the database too far?
Best wishes,
Hans

User avatar
tknijnenburg
NewLounger
Posts: 10
Joined: 30 Jun 2015, 11:46
Location: The Hague

Re: search for a part of a field in a combobox in a subform

Post by tknijnenburg »

My bad.

The cbofilter part was something I found on the net, but didn't use.
You do not have the required permissions to view the files attached to this post.
Grtz, Ton

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: search for a part of a field in a combobox in a subform

Post by HansV »

Your current code allows you to search for part of the description:

S2284.png

I guess I haven't understood your question. Could you try to explain it again?
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
tknijnenburg
NewLounger
Posts: 10
Joined: 30 Jun 2015, 11:46
Location: The Hague

Re: search for a part of a field in a combobox in a subform

Post by tknijnenburg »

When I want to add a new record, I can select the dropdown and start typing from the first character.
But I want to be able to look for any string anywhere in the field.
For example I need to add "schroeven" but I do not know the exact name. So I want to search for that anywhere in the field and select the field I need.
Grtz, Ton

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: search for a part of a field in a combobox in a subform

Post by HansV »

Which dropdown are you talking about?
Best wishes,
Hans

User avatar
tknijnenburg
NewLounger
Posts: 10
Joined: 30 Jun 2015, 11:46
Location: The Hague

Re: search for a part of a field in a combobox in a subform

Post by tknijnenburg »

HansV wrote:
23 Feb 2023, 16:42
Which dropdown are you talking about?
Artikel omschrijving
Grtz, Ton

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: search for a part of a field in a combobox in a subform

Post by HansV »

I see now. Although it is possible in theory, it has nasty side effects in a continuous form. I'd leave it as it is.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78474
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: search for a part of a field in a combobox in a subform

Post by HansV »

If you'd like to try it, see the attached database. The combo box acts weirdly, in my opinion.

Database1.zip
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
tknijnenburg
NewLounger
Posts: 10
Joined: 30 Jun 2015, 11:46
Location: The Hague

Re: search for a part of a field in a combobox in a subform

Post by tknijnenburg »

HansV wrote:
23 Feb 2023, 19:26
If you'd like to try it, see the attached database. The combo box acts weirdly, in my opinion.


Database1.zip
Thanks for sharing, Hans.
It indeed acts weirdly, but it does do the job.
Grtz, Ton