Use Query search in Navigation form

If you give it only "Elektronic" how many counts does it give you? 4, perhaps?

Had you changed from "OR" to "AND" when you did those runs?

Yes i've changed "OR" to "AND"
And it works perfect:D
 
You only have a wildcard after, so hits have to start with the word. To find it anywhere:

sFilter = sFilter & "( [category] Like '*" & [txtCategory] & "*' ) "

Thanks it's works:D
 
Happy to help!
 
Happy to help!

Now I have another question.
Don't know if i should make a new thread....

Everything is now search as you type and it's filters very detailed. That's very nice for me and others who knows what to search.

I was thinking about to creating a multiple "combo boxes" that are connected to each other. I hope you will understand where i want to go:)

Like for example:

I want to have 3 combo boxes... (don't have a working combo boxes)

1e combo box is "Category" (here you will see a list with: "elektronic / holder", "elektronic" and "holder")

2nd combo box is "Supplier" (here you will see a list with: "DOS", "HEL", "BEK" and "SOP")

3rd combo box is "Color" (here you will see a list with: "Black", "White" and "Red")

Questions:confused::

-How can I make take the three combo boxes that gives the right source of data? (from the table: tblProduct)
-The combo boxes must connected with each other (form: Test combo box). How do you do that? (if you choose in the first combo box "elektronic" then the second box gives automatically a list with 3 different suppliers: DOS, HEL and BEK based on the first combo box. And so on with the third box (Color)).
-Can it be 2 ways traffic like if I only know Color (Black) and Supplier (DOS) then the Catergory box should automatically gives me a list with only "DevTab1" and "DevHol1" choices.
Is it possible 2 (multiple) ways?
-Is it possible to make a preview form (like layout form: Test combo box) that automatically show the result dependent on the 3 combo boxes together?

So if everything is linked try a test run, examples:
first box Category select: Elektronic
second box Supplier select: DOS
third box Color select: Black
Should give me 1 result

or

second box Supplier select: Black
third box Color select: Dos
Should give me 2 results


I will attach my access file.

Hope you can help me with this problem:banghead::confused:
 

Attachments

Re setting up any searching, normalise your database first with separate tables for at least products and suppliers.
 
The question SOUNDS like something you might do by tapping into the .LostFocus event on each combo box.

To make the combo boxes sensitive to other choices, you are making an implied dependency in the order in which you MAKE those choices. Which means if you have cboA, cboB, and cboC, you would have to disable cboB and cboC until a choice has been made in cboA. If there was a third combo, you would keep IT disabled until the first two had choices, and so on. Also, if you start to choose something from cboB, you probably need to lock (.Locked = True) cboA. Otherwise, you would end up with all sorts of craziness if you tried to change an earlier selection that had governed a middle selection. In essence, you would have to undo subsequent selections.

As to how you do it, the .LostFocus routine of cboA would have to decide if the box now has a selection. If so, then rework the .RowSource of cboB to reflect the selection in cboA (probably by adding a WHERE clause to that SELECT query) and then enable cboB. Then have cboB's .GotFocus lock cboA.

This also implies that you would need a function to reset everything to its starting point so that you could make a new selection in cboA again to start another cascade of selections.

As to difficulty - this isn't terribly tough code, but it IS terribly tedious. And you HAVE to be able to think through the sequencing step-by-step. The individual actions to do this kind of thing are all similar. That is, the .LostFocus routines of all but the LAST combo in the sequence will resemble each other, except for specific control names that would be affected. All but the FIRST combo's .GotFocus routines will be similar except for the specifically affected control names.

Look up "Cascading Combo Boxes" with this forum's SEARCH function to see many detailed articles on this subject. It comes up A LOT.
 
Now I got a new problem....:banghead:
I've made a from with two combo boxes to find something easier. The problem is, if I added the form (name is: TestComboBox1) to the navigation form it doesn't work anymore. I get an error like: enter parameter value "Forms!TestComboBox1!cbosuppliertest

How can I solve this?
I will attach my file so you can see it for yourself at Navigation form > product overview > overview and then select anything from supplier combo box

Note: I'm a beginner with VBA and writing codes:confused:

Please help me out..:)
Thanks a lot
 

Attachments

Users who are viewing this thread

Back
Top Bottom