PDA

View Full Version : Filtering an ADODB recordset



lifeson
03-23-2009, 05:07 AM
Is it possible to filter a ADODB recordset on more than 1 field at a time?

e.g
If cGroup = vbNullString Then
'MsgBox "No filter applied"
Else
If cType = vbNullString Then
rst.Filter = "ComponentGroupID = '" & cGroup & "'"
Else
' I have tried a few variations of this but got nowhere
rst.Filter = "ComponentTypeID = '" & cType & "' AND ComponentGroupID = '" & cGroup & "'"""
End If
End If

Bob Phillips
03-23-2009, 06:48 AM
That should work, is ID a text field?