[AccessD] Using a Function in a WHERE IN clause

Rojas, Joe Joe.Rojas at symmetrymedical.com
Tue Jan 5 11:52:27 CST 2010


Hello,

I am trying to use a custom function in a IN clause of a query.
The function cycles through a multi-select list box and builds a string based on what the user picked.
The WHERE clause looks like this: WHERE localPartPlant.PersonID In (GetPlannerCodes())

The problem I'm having is figuring out how the string should be formatted when more than one item is selected.
When one item is select, the string has to have no quotes, no double quotes, and no commas. For example, CX
If I do this with one item, the query works.

When multiple items are selected, I have tried the following string formats:
"CX", "CX1"
'CX', 'CX1'
CX, CX1
CX', 'CX1
CX", "CX1

All to no avail.

Anyone know how to achieve this?

Joe Rojas
Information Technology Manager
Symmetry Medical New Bedford
P: 508.998.4575
M:508.838.4717
F:508.995.9597
joe.rojas at symmetrymedical.com<mailto:joe.rojas at symmetrymedical.com>




More information about the AccessD mailing list