Hi,
Can anybody help me with "IN" clause parameters in a stored query?
My insert qryMyAmts query contains such a clause:
It runs fine.
I want to call it from VBA in Access and I changed the clause to
My VBA code is like this:
Where for strMyAdmKeyList I tried to assign this: "'1','2','3'" and this: "1,2,3".
In both cases the query inserts nothing. However, if the list contains just one value, it works.
May be somebody knows how to prepare such a parameter?
Thank you!
vladk
Can anybody help me with "IN" clause parameters in a stored query?
My insert qryMyAmts query contains such a clause:
SQL:
WHERE MY_AMTKEY IN ('1','2','3')
I want to call it from VBA in Access and I changed the clause to
SQL:
WHERE MY_AMTKEY IN ([MyAdmKeyList])
My VBA code is like this:
Code:
Dim qdf As DAO.QueryDef
Set qdf = CurrentDb.QueryDefs("qryMyAmts")
qdf.Parameters("MyAdmKeyList").value = strMyAdmKeyList
qdf.Execute
Where for strMyAdmKeyList I tried to assign this: "'1','2','3'" and this: "1,2,3".
In both cases the query inserts nothing. However, if the list contains just one value, it works.
May be somebody knows how to prepare such a parameter?
Thank you!
vladk