Hello. I have the following test subroutine where table tblTEST has field MsgID (numbers). This test sub emulates a problem within my code. I'm trying to dynamically filter an open recordset. My filter relies on the "MsgID] IN ( ... )" syntax used in queries; however, when this same tactic is used in a recordset, I get a run-time error '3001': Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."
Here's the TEST subroutine.
sub Test()
Dim rst As Recordset
Dim strFilter As String
Set rst = New ADODB.Recordset
rst.Open ("tblTEST"
, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
strFilter = "MsgID IN (1,2)"
rst.Filter = strFilter
rst.Close
End Sub
Does anyone know of a solution??? I'm using Access2000 and ADO. Any assistance is appreciated.
- Lorentz
Here's the TEST subroutine.
sub Test()
Dim rst As Recordset
Dim strFilter As String
Set rst = New ADODB.Recordset
rst.Open ("tblTEST"
strFilter = "MsgID IN (1,2)"
rst.Filter = strFilter
rst.Close
End Sub
Does anyone know of a solution??? I'm using Access2000 and ADO. Any assistance is appreciated.
- Lorentz