Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default build param string for WHERE IN (....)

See this:

http://www.dbforums.com/showthread.p...65#post4447965

--
Regards,
Tom Ogilvy



wrote in message
ups.com...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default build param string for WHERE IN (....)

Tom, thank U for the response but the problem mentioned in the posting
(through the link U provided) is different from mine: i'm sending one
parameter which contains a list of strings (not a list of parameters)
but in the example from your link is an attempt to append parameter to
another parameter ...
well, at least as I'm interpreting my issue..
cheers
D.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default build param string for WHERE IN (....)

Sounds to me like you either need a single string that has a list of comma
separated words in it

"red,blue,green"

or you need an array (if the parameter will accept an array).

--
Regards
Tom Ogilvy

wrote in message
oups.com...
Tom, thank U for the response but the problem mentioned in the posting
(through the link U provided) is different from mine: i'm sending one
parameter which contains a list of strings (not a list of parameters)
but in the example from your link is an attempt to append parameter to
another parameter ...
well, at least as I'm interpreting my issue..
cheers
D.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to build a formula from a string of text DR Excel Worksheet Functions 2 March 7th 08 12:12 AM
open a spreadsheet with param ITDUDE27 Excel Discussion (Misc queries) 1 April 19th 06 07:55 AM
Haeder/Footer param Erik Creyghton Excel Programming 4 July 27th 04 08:58 PM
CorruptLoad param of Workbooks.Open Microsoft Excel Programming 6 April 17th 04 10:50 PM
How to build build a macro that automatically imports PedroPeso Excel Programming 1 December 26th 03 08:14 PM


All times are GMT +1. The time now is 03:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"