I have 3 fields for search
1. Combo box which is operator name
2.From Date
3.To Date
I have written code and attached form image below which is not working.Please help me to solve this problem.
Code:
Private Sub BtnSearch_Click()
Call SearchBtn
End Sub
Sub SearchBtn()
Dim strCriteria As String
Dim task As String
Me.Refresh
If IsNull(Me.Operator) Or IsNull(Me.Fdate) Or IsNull(Me.Tdate) Then
MsgBox "Please Enter the Required Date", vbInformation, "Date Required"
Me.Fdate.SetFocus
Else
strCriteria = "(([Operator_Name])<=#" & Me.Operator & "# And ([Production_Date])>=#" & Me.Fdate & " # And ([Production_Date])<=#" & Me.Tdate & "#)"
task = "Select * from Operator_Efficiency_Query where (" & strCriteria & ") Order By [Production_Date]"
DoCmd.ApplyFilter task
End If
End Sub
![]()