Try using # delimiters instead of * for the dates.
Made several other syntax changes also. Date is a reserved word in Access. I changed the table field name from Date to dDate.
Eliminated the call to Search, as I combined the two procedures.
Code:
Private Sub Search_Click()
' Search
Dim strCriteria, task As String
Me.Refresh
If IsNull(Me.FromDate) Or IsNull(Me.ToDate) Then
MsgBox " Enter the Date Range", vbInformation, "Date Range required "
Me.FromDate.SetFocus
Else
'i want to click search command button after input from date and to date field value then it return all corresponding records.
strCriteria = "[dDate]>= #" & Me.FromDate & "# And [dDate] <= #" & Me.ToDate & "#"
task = " select * from WOpr where " & strCriteria & " order By [dDate]"
'Debug.Print task
'DoCmd.ApplyFilter , task
Me.RecordSource = task
End If
End Sub