IN Clause in the Filter Property 
Author Message
 IN Clause in the Filter Property

Greetings Folks,

I am trying to use an IN/NOT IN clause in the filter property.  But VB comes
back with this error:
3001 Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

Is it possible to use the IN clause in the filter property?

--
Thanks
WD

PS Reply to group or Send me an email remove _NOSPAM_ From the address



Sun, 24 Oct 2004 02:07:53 GMT  
 IN Clause in the Filter Property


Greetings Folks,

I am trying to use an IN/NOT IN clause in the filter property.  But VB comes
back with this error:
3001 Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

Is it possible to use the IN clause in the filter property?

Could you post your SQL statement so we have something to look at?


Microsoft MVP (Visual Basic)



Sun, 24 Oct 2004 21:48:41 GMT  
 IN Clause in the Filter Property
Here it is

 SELECT
  COURTPOS_ID,
  COURTPOS_DESC =

       WHEN 'E' then COURTPOS_DESC
       ELSE  COURTPOS_DESC_F
  END
 FROM
  COURTPOS

This comes from an SQL server SP.

All records come back

Now in VB I have something like this:

sFilterString = "(1, 2)"
rsCourtPos.Filter = "COURTPOS_ID NOT IN " & sFilterString

If I redo the filter with a long winded COURTPOS_ID = 1 AND COURTPOS_ID = 2
....etc
It works fine...But as you can guess it is really slow.

--
Thanks
WD

PS Reply to group or Send me an email remove _NOSPAM_ From the address


Quote:
> On Tue, 07 May 2002 18:07:53 GMT, "WD"


Quote:

> Greetings Folks,
>
> I am trying to use an IN/NOT IN clause in the filter property.  But VB
comes
> back with this error:
> 3001 Arguments are of the wrong type, are out of acceptable range, or
are in
> conflict with one another.
>
> Is it possible to use the IN clause in the filter property?

> Could you post your SQL statement so we have something to look at?


> Microsoft MVP (Visual Basic)



Mon, 25 Oct 2004 03:13:31 GMT  
 IN Clause in the Filter Property
The ADO property FILTER does not support IN.

--
Paul Thornett


Quote:
> Now in VB I have something like this:

> sFilterString = "(1, 2)"
> rsCourtPos.Filter = "COURTPOS_ID NOT IN " & sFilterString



Mon, 25 Oct 2004 07:53:36 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. filter clause in Outlook's Find property

2. syntax for WHERE-clause in filter in VBA ?

3. syntax for WHERE-clause in filter in VBA ?

4. Invalid filter in WHERE clause

5. Amazing: rs.filter shows no records where WHERE clause bring plenty

6. Setting the Filter property on subform

7. Trouble with the .Filter property

8. Trouble with the .Filter property

9. Unbound form and Filter Property

10. Filter property on Find method

11. Language-dependent properties in filter conditions

12. Using Built-In Properties as a search filter on closed files

 

 
Powered by phpBB® Forum Software