Paul im not that much good with codes !
I use this vba code but there is one problem, it not take the values i put it in boxs!
Private Sub Toggle3_Click()
Dim strReport As String
Dim strDateField As String
Dim lngLen As Long
Dim strWhere As String
Dim lngView As Long
Const conJetDate = "\#mm\/dd\/yyyy\#"
strReport = "rptFLM"
strDateField = "[Date]"
lngView = acViewReport
If Not IsNull(Me.txtlocation) Then
strWhere = strWhere & "([Location] Like ""*" & Me.txtlocation & "*"") AND "
End If
If Not IsNull(Me.txtDateFrom) Then
strWhere = strWhere & "([Date] >= " & Format(Me.txtDateFrom, conJetDate) & ") AND "
End If
If Not IsNull(Me.txtDateTo) Then
strWhere = strWhere & "([Date] < " & Format(Me.txtDateTo, conJetDate) & ") AND "
End If
If Not IsNull(Me.txtTagNumber) Then
strWhere = strWhere & "([Tag Number] Like ""*" & Me.txtTagNumber & "*"") AND "
End If
If Not IsNull(Me.txtCreatedby) Then
strWhere = strWhere & "([Created by] Like ""*" & Me.txtCreatedby & "*"") AND "
End If
If Not IsNull(Me.txtJSA1) Then
strWhere = strWhere & "([JSA / Procedure] Like ""*" & Me.txtJSA1 & "*"") AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else
strWhere = Left$(strWhere, lngLen)
Debug.Print strWhere
Me.Filter = strWhere
Me.FilterOn = True
End If
If CurrentProject.AllReports(strReport).IsLoaded Then
DoCmd.Close acReport, strReport
End If
DoCmd.OpenReport strReport, lngView, strWhere
Exit_Handler:
Exit Sub
End Sub