form filter for date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a cmd button on a form to change the date filter with the following code:
DateSelect is an unbound control. I get no records when I move from one date to the next. The DateSelect control reflects the change, but no records are pulled when I know there are records that match the specified date.
What am I missing?
Thanks, guys!!

Private Sub cmdWKb_Click()
Dim a As String

Me.DateSelect = Me.DateSelect - 7
a = "[ApptDate]= " & Me.DateSelect

Me.Filter = a & " and " & Me.ApptTypeID = 2
Me.FilterOn = True
Me.OrderBy = "ApptStart"
End Sub
 
You may need to requery or refresh the form at the end of
your code routine.
-----Original Message-----
I have a cmd button on a form to change the date filter with the following code:
DateSelect is an unbound control. I get no records when I
move from one date to the next. The DateSelect control
reflects the change, but no records are pulled when I know
there are records that match the specified date.
What am I missing?
Thanks, guys!!

Private Sub cmdWKb_Click()
Dim a As String

Me.DateSelect = Me.DateSelect - 7
a = "[ApptDate]= " & Me.DateSelect

Me.Filter = a & " and " & Me.ApptTypeID = 2
Me.FilterOn = True
Me.OrderBy = "ApptStart"
End Sub
.
 
Back
Top