form filter for date

J

Josh M

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
 
J

Jaden

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
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top