Hello all,
I have a main form that contains two textboxes (FromDate and ToDate) and a button (ApplyDates). When clicking on the button, I'd like to use the dates inputted into the textboxes to filter out data in a subform (SubByDate). The data displayed should be between the two dates inputted. Here is my code:
Private Sub ApplyDates_Click()
Dim FromFilter As String
Dim ToFilter As String
FromDate = Me.FromDate
ToDate = Me.ToDate
FromFilter = "#" & FromDate & "#"
ToFilter = "#" & ToDate & "#"
If Len(strFilter) Then
Forms!SubByDate.Filter = "[ReleaseDate] >=" & FromFilter & "AND [ReleaseDate] <=" & ToFilter
Forms!SubByDate.FilterOn = True
End If
End Sub
My problem is that nothing happens when clicking on the button. Can anyone tell me what I'm missing/doing wrong?
Thanks!