subform filtering problem

T

TMH

I have a form with employee data and a subform (continuos form view) with
time tracking information.

Employee Form: (from employee table) employee ID, employee name

Time Tracking subform: task, date, employee ID (master/child linked field),
minutes, and a few other descriptive fields.

I am trying to create a combo box that will filter the records visible in
the subform by date.

The source for the combo box cboSelectDate is:
SELECT qryTimeTrackingOneEmployee.Date
FROM qryTimeTrackingOneEmployee
ORDER BY qryTimeTrackingOneEmployee.Date;
(selects only dates that this particular employee has tasks for)

The AfterUpdate property is set to:

Private Sub cboSelectDate_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Date] = #" & Format(Me![cboSelectDate], "mm\/dd\/yyyy") &
"#"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

This goes to the first record with the selected date, but does not limit the
records being viewed to ONLY those tasks for the selected date.

I tried:

DoCmd.ApplyFilter , "[Date] = #" & Format(Me![cboSelectDate],
"mm\/dd\/yyyy") & "#"

But it did not work. It asks for parameter values for the fields. I've
tried with and without [ ] Please help.

TMH
 
Top