A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Multi-select Error-allenbrowne



 
 
Thread Tools Display Modes
  #1  
Old April 11th, 2008, 06:04 PM posted to microsoft.public.access.forms
Deron
external usenet poster
 
Posts: 13
Default Multi-select Error-allenbrowne

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) & ")"
  #2  
Old April 12th, 2008, 11:13 AM posted to microsoft.public.access.forms
Wolfgang Kais[_3_]
external usenet poster
 
Posts: 68
Default Multi-select Error-allenbrowne

Hello Deron.

"Deron" wrote:
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, ",", ";")

--
Regards,
Wolfgang


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.