Hi, can anyone help, this is my first post regarding Access, I have the code below which works but the only problem is if I put in dates
I get nothing even though there is data on that date.
If I enter dates it works fine
any help would be great.
If I enter dates it works fine
VBA Code:
Dim strCriteria, task As String
Me.Refresh
If IsNull(Me.StartDate) Or IsNull(Me.EndDate) Then
MsgBox "Please enter a date range", vbInformation, "Date range required"
Me.StartDate.SetFocus
Else
strCriteria = "([Date] >=#" & Me.StartDate & " 00:00:00# And [Date] <=#" & Me.EndDate & " 23:59:59#)"
task = "select * from StoresData where (" & strCriteria & ") order by [Date]"
DoCmd.ApplyFilter task
End If