How can I determine if the filter that I just created at run-time returns nothing. This is what I am trying however it seems to return the wrong recordcount and records. I am using VBA / Access 2002
VB Code:
SQL = "Name LIKE '* TODD *'" 'Determine if there are any records to show Form_frmLocateSuboenaSubfrm.Filter = SQL Form_frmLocateSuboenaSubfrm.FilterOn = True Form_frmLocateSuboenaSubfrm.Requery Dim Qry As Recordset Set Qry = CurrentDb.OpenRecordset( Form_frmLocateSuboenaSubfrm.Filter) 'Set Qry = CurrentDb.OpenRecordset( Form_frmLocateSuboenaSubfrm.RecordSource) If Qry.RecordCount = 0 Then MsgBox("No Match Found!") Else Form_frmLocateSuboenaSubfrm.FilterOn = false End If
However when I do this there should be 2 names with TODD, but the recordset shows 1 record, but the name is KIM.


Reply With Quote