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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Compile error - Syntax error
I'm trying to set up a multiselect listbox for a query parameter. I found a
reference to http://www.mvps.org/access/forms/frm0007.htm for code to accomplish this. However when I copied and pasted this code into my code window the last line - strSQL=left$(strSQL,len(strSQL)-12)) was highlighted in red. Debug shows it to be a syntax error. How do I correct this? -- Thanks for your help! Walter |
#2
|
|||
|
|||
Compile error - Syntax error
Correct me if I'm wrong, but do you not have 1 too many brackets??? Should
it not be: strSQL = Left$(strSQL, Len(strSQL) - 12) -- Hope this helps, Daniel Pineault http://www.cardaconsultants.com/ For Access Tips and Examples: http://www.devhut.net Please rate this post using the vote buttons if it was helpful. "Walter" wrote: I'm trying to set up a multiselect listbox for a query parameter. I found a reference to http://www.mvps.org/access/forms/frm0007.htm for code to accomplish this. However when I copied and pasted this code into my code window the last line - strSQL=left$(strSQL,len(strSQL)-12)) was highlighted in red. Debug shows it to be a syntax error. How do I correct this? -- Thanks for your help! Walter |
#3
|
|||
|
|||
Compile error - Syntax error
On Thu, 31 Dec 2009 09:30:01 -0800, Walter
wrote: I'm trying to set up a multiselect listbox for a query parameter. I found a reference to http://www.mvps.org/access/forms/frm0007.htm for code to accomplish this. However when I copied and pasted this code into my code window the last line - strSQL=left$(strSQL,len(strSQL)-12)) was highlighted in red. Debug shows it to be a syntax error. How do I correct this? This appears to be the very common References bug. Open any module in design view, or open the VBA editor by typing Ctrl-G. Select Tools... References from the menu. One of the ..DLL files required by Access will probably be marked MISSING. Uncheck it, recheck it, close and open Access. If none are MISSING, check any reference; close and open Access; then uncheck it again. This will force Access to relink the libraries. -- John W. Vinson [MVP] |
#4
|
|||
|
|||
Compile error - Syntax error
I got it worked out - extra parenthesis on the end.
-- Thanks for your help! Walter "Walter" wrote: I'm trying to set up a multiselect listbox for a query parameter. I found a reference to http://www.mvps.org/access/forms/frm0007.htm for code to accomplish this. However when I copied and pasted this code into my code window the last line - strSQL=left$(strSQL,len(strSQL)-12)) was highlighted in red. Debug shows it to be a syntax error. How do I correct this? -- Thanks for your help! Walter |
Thread Tools | |
Display Modes | |
|
|