if the error as below:
Option Compare Database
Private Sub Command77_Click()
'search button
Call Search
End Sub
Sub Search()
Dim strcriteria, task As String
Me.Refresh
If IsNull(Me.OrderDataFrom) Or IsNull(Me.OrderDataTo) Then
MsgBox "Please enter the date range", vbInformation, "Date Range Required"
Me.OrderDataFrom.SetFocus
Else
strcriteria = "([EffectiveDate] >= #" & Me.OrderDataFrom & "# And [EffectiveDate] <= #" & Me.OrderDataTo & "#)"
task = "select * from table1 where(" & strcriteria & ") order by [EffectiveDate]"
DoCmd.ApplyFilter task ←←error in this step
End If
End Sub
please help me to solve this problem
Option Compare Database
Private Sub Command77_Click()
'search button
Call Search
End Sub
Sub Search()
Dim strcriteria, task As String
Me.Refresh
If IsNull(Me.OrderDataFrom) Or IsNull(Me.OrderDataTo) Then
MsgBox "Please enter the date range", vbInformation, "Date Range Required"
Me.OrderDataFrom.SetFocus
Else
strcriteria = "([EffectiveDate] >= #" & Me.OrderDataFrom & "# And [EffectiveDate] <= #" & Me.OrderDataTo & "#)"
task = "select * from table1 where(" & strcriteria & ") order by [EffectiveDate]"
DoCmd.ApplyFilter task ←←error in this step
End If
End Sub
please help me to solve this problem