J
Jon Lewis
I've have the following clause to apply as a form Filter in VBA:
strFilter = "[CompanyID] IN (SELECT [CompanyID] From qryCompaniesCategories
WHERE [CategoryName] IN ( " & strCategories & "))"
strCategories is constructed in code correctly (as far as I'm aware) so if
strFilter is examined when debugging it would read as an example:
strFilter = [CompanyID] IN (SELECT [CompanyID] From qryCompaniesCategories
WHERE [CategoryName] IN ( 'Name1', 'Name2', 'Name3'))
The problem is this only ever returns Name1 companies (or whatever the first
item in the list is). qryCompaniesCategories is a well used query so has
nothing to do with the problem.
Have been wrestling with this for ages (tried with & without space after the
comma separating the 'Name's BTW).
TIA
strFilter = "[CompanyID] IN (SELECT [CompanyID] From qryCompaniesCategories
WHERE [CategoryName] IN ( " & strCategories & "))"
strCategories is constructed in code correctly (as far as I'm aware) so if
strFilter is examined when debugging it would read as an example:
strFilter = [CompanyID] IN (SELECT [CompanyID] From qryCompaniesCategories
WHERE [CategoryName] IN ( 'Name1', 'Name2', 'Name3'))
The problem is this only ever returns Name1 companies (or whatever the first
item in the list is). qryCompaniesCategories is a well used query so has
nothing to do with the problem.
Have been wrestling with this for ages (tried with & without space after the
comma separating the 'Name's BTW).
TIA