Form Filtering Question

Tallbloke

Registered User.
Local time
Today, 21:56
Joined
Aug 17, 2006
Messages
66
Hi there, I've been looking at this for hours and not getting anywhere fast.

I have a form that I want to filter based on a combo box. The combo box filter contains only three options.

Daytime
Evening
Daytime & Evening

The only difference between this filter and others I have used is that the filter is to be applied to a combo box on the main form.

I.e. I'm filtering a form with a combo box on a combo box....

I've been trying something like this but not having much joy :

Code:
Dim FilterType As String
FilterType = "SupplierType = " & Chr(34) & Me.TypeCombo.Column(1) & Chr(34)
Me.Filter = FilterType
Me.FilterOn = True

I can filter the form using the ribbon controls, but really want to do this with VBA.

Any help would be appreciated :)
 
Ok...I've cheated a bit to get this to work.

After update on the combo box I write the column value into a hidden text box (called CheatBox) and then run this code on button click :

Code:
Dim FilterType As String
FilterType = "SupplierType =" & Me.CheatBox
Me.Filter = FilterType
Me.FilterOn = True

End Sub

Not sure why this code wouldn't work with

Code:
FilterType = "SupplierType =" & Me.TypeCombo.column(0)

Though....
 
Oh, it does :)

Hehehe
 
Could someone help me with the syntax to combine filters?

So on the click of one button 2 filters are applied to a form?
 

Users who are viewing this thread

Back
Top Bottom