D
DocBrown
I hope someone can tell me what I'm missing here...
I have the following query:
SELECT ZipData.EventID, ZipData.ZipCode, ZipData.Count
FROM Events INNER JOIN ZipData ON Events.EventID=ZipData.EventID
WHERE ((Events.ProgramArea) In (Reports![Programs Activities
Cumulative]!ProgramArea_List)) And ((ZipData.EventID) In (2,4,7))
ORDER BY ZipData.ZipCode;
The ProgramArea field can have 5 different string values. The TextBox
ProgramArea_list is an unbound control that gets it's value from VBA code.
When the TextBox contains only one item in a list, the query works. When the
list contains more than one, it doesn't. No records are returned. When I put
in the literal strings it also works:
SELECT ZipData.EventID, ZipData.ZipCode, ZipData.Count
FROM Events INNER JOIN ZipData ON Events.EventID=ZipData.EventID
WHERE ((Events.ProgramArea) In ("Visual Arts","BioSite")) And
((ZipData.EventID) In (2,4,7))
ORDER BY ZipData.ZipCode;
I have tried building the list with Quote delimiters and without as follows:
Visual Arts <- works
BioSITE,Visual Arts <- Does not work
"BioSITE","Visual Arts" <- Does not work
Nothing I can figure out will make the first query work with more than one
item in the list. I am trying out the query in the SQL View of the query
builder.
Any ideas?
Thanks,
John
I have the following query:
SELECT ZipData.EventID, ZipData.ZipCode, ZipData.Count
FROM Events INNER JOIN ZipData ON Events.EventID=ZipData.EventID
WHERE ((Events.ProgramArea) In (Reports![Programs Activities
Cumulative]!ProgramArea_List)) And ((ZipData.EventID) In (2,4,7))
ORDER BY ZipData.ZipCode;
The ProgramArea field can have 5 different string values. The TextBox
ProgramArea_list is an unbound control that gets it's value from VBA code.
When the TextBox contains only one item in a list, the query works. When the
list contains more than one, it doesn't. No records are returned. When I put
in the literal strings it also works:
SELECT ZipData.EventID, ZipData.ZipCode, ZipData.Count
FROM Events INNER JOIN ZipData ON Events.EventID=ZipData.EventID
WHERE ((Events.ProgramArea) In ("Visual Arts","BioSite")) And
((ZipData.EventID) In (2,4,7))
ORDER BY ZipData.ZipCode;
I have tried building the list with Quote delimiters and without as follows:
Visual Arts <- works
BioSITE,Visual Arts <- Does not work
"BioSITE","Visual Arts" <- Does not work
Nothing I can figure out will make the first query work with more than one
item in the list. I am trying out the query in the SQL View of the query
builder.
Any ideas?
Thanks,
John