Dynamic Search using combobox and textboxes (1 Viewer)

theantz

New member
Local time
Today, 10:14
Joined
Dec 13, 2015
Messages
7
Hi,

I have been using this code by Big John Booty (thanks Big John)

showthread.php?t=188663
(can't post link yet so you know what to do with that) :)

Now I need to create a combobox for specific searches like what he did in his demo file but he is using option boxes.

I looked at the code but I cannot tell which one is responsible for filtering the result based on the values of the option boxes. I only 3 line of codes in the click event of each option group.

Code:
    Me.SearchResults.Requery
    Me.SearchResults = Me.SearchResults.ItemData(1)
    Me.SearchFor.SetFocus
Looks like to me that it is responsible only to refresh the query but I don't get the part how it filter based on the current value of the option group.


I want to use the same method as Big John but using combo box.

What I did so far is add this in the criteria of the query

Code:
[forms]![Projects]![cmb_ProjectStatus]

then add a combobox on the form and name it cmb_ProjectStatus

Row Source of the combobox is
1;"All";2;"Cancelled";3;"Completed";4;"Invoiced";5;"Progress"

Bound column 1

Doesn't filter my result.

Anything I miss?

Thanks
 

Ranman256

Well-known member
Local time
Today, 02:14
Joined
Apr 9, 2015
Messages
4,339
I dont think you want bound column as 1.
are you filtering on 1,2,3 (col 1)
or
do you want to filter on Cancelled, Completed col (2)?

me, I have the form connected to my query, pick the item in the combo then filter:

Code:
sub cboFilter_AfterUpdate()
me.filter = "[action]='" & cboFilter & "'"
me.filterOn = true
 

theantz

New member
Local time
Today, 10:14
Joined
Dec 13, 2015
Messages
7
Hi Ranman256,

Thanks a lot for suggestion of doing it another way.

However, i have built my code around John big Booty code as referenced in my OP.

Can you help me understand how his option box works.

Thanks


Thanks also for the info about Bound column.
 

Users who are viewing this thread

Top Bottom