Hi everybody,
I try to open a ADODB recordset writing below lines;
rs.Open "select * from tblItems where ItemId In (strList2)", _
cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect
strList2 is a string consisting of concatanating selected Items' ItemData on
a previous form's list box. So it's like "'2','5','4'". The problem is,
ItemId field of tblItems is Autonumber. So ERROR OCCURED message appears.
When I change the SQL line to
....where ItemId In (2,6,5)
It works.
What should I do? I have a string and, naturally, I can't use it in SQL
to select a number field. Is there a way out for me?
Much thanks in advance
Murat
I try to open a ADODB recordset writing below lines;
rs.Open "select * from tblItems where ItemId In (strList2)", _
cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect
strList2 is a string consisting of concatanating selected Items' ItemData on
a previous form's list box. So it's like "'2','5','4'". The problem is,
ItemId field of tblItems is Autonumber. So ERROR OCCURED message appears.
When I change the SQL line to
....where ItemId In (2,6,5)
It works.
What should I do? I have a string and, naturally, I can't use it in SQL
to select a number field. Is there a way out for me?
Much thanks in advance
Murat