Hi guys

I've designed a form in access that filters records from a corresponding table in the same database. Each individual filter works really well but i want them to work in conjunction with one another so for example searching a surname and date at the same time. I've pasted the script below and would appreciate any advice you can give me with it

all the best

baggers

Option Compare Database

Private Sub cmdFilter_Click()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtSurname) Then
strWhere = strWhere & "([PtSurname] Like ""*" & Me.txtSurname & "*"")"
End If
If Not IsNull(Me.txtFilterSite) Then
strWhere = strWhere & "([Site] Like ""*" & Me.txtFilterSite & "*"")"
End If
If Not IsNull(Me.TextUserName) Then
strWhere = strWhere & "([User] Like ""*" & Me.TextUserName & "*"")"
End If
If Not IsNull(Me.Textdate) Then
strWhere = strWhere & "([TransferDate] Like ""*" & Me.Textdate & "*"")"
End If
Me.Filter = strWhere
Me.FilterOn = True
End Sub

Private Sub cmdReset_Click()

Dim ctl As Control
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox
ctl.Value = Null
Case acCheckBox
ctl.Value = False
End Select
Next
Me.Filter = "(False)"
Me.FilterOn = True
End Sub

Private Sub Form_Open(Cancel As Integer)
Me.Filter = "(False)"
Me.FilterOn = True
End Sub