Hi,

I have a query which extracts some records from a table according to some condition. The problem is when I run this query on Access it works perfectly; but when I use it in my VB program it doesn't work properly.

I have "Table1", and "Table2" and field in each called "Index"

"Table1.Index" "Table2.Index"
3 4
2 7
0 5
1 2
9 10

My query is:
"SELECT [Table1].* FROM [Table1] WHERE [Table1].Index NOT IN (Select [Table2].Index FROM [Table2])"

.. this query should return :

0
9
3
1

.. the problem is that if I create a query in Access and paste this code it work perfectly but when I use it in VB it returns only the first record .. I don’t know why??

Could anyone help

Thank you in advance.

Wesam

------------------