Hi!
I've got a form based on a table.
I would like to filter my form based on two combo boxes "cmb1" and "cmb2".
I want the filter to be applied when pressing a button. The button vba is:
Private Sub btnOK_Click()
Me.Filter = "field1= " & Me.cmb1 AND "field2= " & Me.cmb2
Me.FilterOn = True
End Sub
But when I press the button after choosing values in the combo boxes I get an error "incompatible types".
Both field1 and field2 are value types.
What am I doing wrong?
Thanks!
I've got a form based on a table.
I would like to filter my form based on two combo boxes "cmb1" and "cmb2".
I want the filter to be applied when pressing a button. The button vba is:
Private Sub btnOK_Click()
Me.Filter = "field1= " & Me.cmb1 AND "field2= " & Me.cmb2
Me.FilterOn = True
End Sub
But when I press the button after choosing values in the combo boxes I get an error "incompatible types".
Both field1 and field2 are value types.
What am I doing wrong?
Thanks!