Select Items in List from a String

mwn1218

Registered User.
Local time
Today, 13:43
Joined
Jan 26, 2005
Messages
30
I have a string (strFilter) that is used to store a filter for a report. It is created from a list box (containing project numbers) on a form and when the user prints the report it ask them to save it and it stores strFilter in a table. What I need to do is when the user selects an existing report I would like for the list box to have the Items selected that are in strFilter:

strFilter = [ProjID] In ('1','5','4','7')

So when they select an existing report i would like the list box to have those Items selected. Thanks for the help.
 
Separate the string

You need to separate the string. (Instr() and Mid())

str = " ... WHERE "

Then run a loop to build your query (Loop using Instr())
str = str & str
 

Users who are viewing this thread

Back
Top Bottom