View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] dim1ann@yahoo.com is offline
external usenet poster
 
Posts: 10
Default build param string for WHERE IN (....)

Hi,
i'm trying to build a parameter in VBA as a list stings to pass it to
MSAccess procedure such as
"select ...from ...WHERE Strategy in ([@Strategy_List]);"

but I'm having problem with quotation marks around each string in a
list.. if only one name is in the list then query works just find but
additing second string to the list breaks it...


Set ParamStrategy = .CreateParameter("@Strategy_List", adVariant,
adParamInput)
'this one will work as only one string in the list
ParamStrategy.Value = "ALL_STRT"
param with two strings fails
'ParamStrategy.Value = "" & """ALL_G""" & "," & """ALL_O""" & ""

would appreciate any help on it
cheers
D.