Filter not working

H

hughess7

Hi all

I am trying to filter a subform using a combo box on the parent form where
the user selects the field to search and an unbound text box for the search
criteria. It now runs without error but it does not return any results so
something is wrong somewhere... I've debugged and the txtCriteria is passed
the correct data but the filter is false? I know the data exists though...

Dim txtSearch As String
Dim frm As Form, strFilter As String

Set frm = Me.frmClaims.Form

txtSearch = Me![txtCriteria]

strFilter = "[" & Me![cboField] & "]" = """ & txtSearch & """""
frm.Filter = strFilter
frm.FilterOn = True

Part 2 of the question will be to make sure I have the correct data type
selected for the sql string. I have the data type of the field stored in
column(1) of the combo box as text eg date/time, text, long integer etc.

Any ideas?

Thanks in advance for any help.
Sue
 
Top