Multi-select Error-allenbrowne

  • Thread starter Thread starter Deron
  • Start date Start date
D

Deron

I used the code from http://allenbrowne.com and seem to have problem with the
line. it worked fine when the table has an auto number column but i removed
that column the table has just one NAME col also it stopped displaying the
names.
When i click the command button it displays all the data wheni select a name
it says syntax error and goes to thsi line!!

can you help

strWhere = "[NAME] IN (" & Left$(strWhere, lngLen) & ")"
 
Hello Deron.

Deron said:
I used the code from http://allenbrowne.com and seem to have problem
with the line. it worked fine when the table has an auto number
column but i removed that column the table has just one NAME col
also it stopped displaying the names.
When i click the command button it displays all the data when i
select a name it says syntax error and goes to thsi line!!

can you help

strWhere = "[NAME] IN (" & Left$(strWhere, lngLen) & ")"

I guess that the problem is that you earlier used a number field and
now the field is of type text. I therefore suggest to use this line:

strWhere = BuildCriteria("[NAME]", dbText, "IN (" & Left$(strWhere, _
lngLen) & ")")

If it happens that the list separator should not be a comma but for
example a semicolon, you should isert a line before that rplaces all
commas by a semicolon, like this:
strWhere = Replace(strWhere, ",", ";")
 
Back
Top