I wrote a simple function that returns a record count. However, the recordset set count I've been returning is always the maximum number of records in the underlying recordset which contains 787 records. Even if the task order is not equal to mTaskOrder (a public variable set in the main form current event), I still get a record count of 787. It's almost as if the filter is not working or rather is returning everything.
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("qryShareAllocation", dbOpenDynaset)
rst.Filter = "[TaskOrder] = '" & mTaskOrder & "'"
If rst.BOF Or rst.EOF Then
GetRecordSetCount = 0
GetRecordSetCount = rst.RecordCount