Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Compile Error

I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default Compile Error

"WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "

The double-quotes aren't paired in this WHERE clause...

"CurtH" wrote:

I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Compile Error

Meaning that I should use them? What you insert looks exactly like the
original code.

"bpeltzer" wrote:

"WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "

The double-quotes aren't paired in this WHERE clause...

"CurtH" wrote:

I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Compile Error

If the error is just building the string, then perhaps:
Tested from the immediate window:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _
& " AND ((IMR Action Items)='Y')); "



--
Regards,
Tom Ogilvy


"CurtH" wrote in message
...
I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default Compile Error

Meaning that they should alway occur in pairs unless you intend them to be
part of the resulting expression. I don't think you want them in your final
SQL expression, but you've got three double quotes on the line (and yes, I
posted back exactly your original code to highlight the line that has the
imbalance).
Perhaps:
"WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items )=
'Y'));"

"CurtH" wrote:

Meaning that I should use them? What you insert looks exactly like the
original code.

"bpeltzer" wrote:

"WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "

The double-quotes aren't paired in this WHERE clause...

"CurtH" wrote:

I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Compile Error

Okay. I understand now. Thanks!

"CurtH" wrote:

Meaning that I should use them? What you insert looks exactly like the
original code.

"bpeltzer" wrote:

"WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "

The double-quotes aren't paired in this WHERE clause...

"CurtH" wrote:

I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Compile Error

eThanks for the input. Both options seem toresolve the issue. But, now I
get Run-time error' -2147217900 (80040e14)': Syntax error (missing operator)
in query "(((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR ACTION TEM)='Y'))'.
Once I select debug this line of code is highlighted:
..Open Source:=Src, ActiveConnection:=Connection

Please advise.



"Tom Ogilvy" wrote:

If the error is just building the string, then perhaps:
Tested from the immediate window:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _
& " AND ((IMR Action Items)='Y')); "



--
Regards,
Tom Ogilvy


"CurtH" wrote in message
...
I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Compile Error

The parentheses aren't balanced in the SQL statement. Delete one of
the three before UNIT.



CurtH wrote:
eThanks for the input. Both options seem toresolve the issue. But, now I
get Run-time error' -2147217900 (80040e14)': Syntax error (missing operator)
in query "(((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR ACTION TEM)='Y'))'.
Once I select debug this line of code is highlighted:
.Open Source:=Src, ActiveConnection:=Connection

Please advise.



"Tom Ogilvy" wrote:

If the error is just building the string, then perhaps:
Tested from the immediate window:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _
& " AND ((IMR Action Items)='Y')); "



--
Regards,
Tom Ogilvy


"CurtH" wrote in message
...
I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "





  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Compile Error

Still same result.

"Andrew Taylor" wrote:

The parentheses aren't balanced in the SQL statement. Delete one of
the three before UNIT.



CurtH wrote:
eThanks for the input. Both options seem toresolve the issue. But, now I
get Run-time error' -2147217900 (80040e14)': Syntax error (missing operator)
in query "(((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR ACTION TEM)='Y'))'.
Once I select debug this line of code is highlighted:
.Open Source:=Src, ActiveConnection:=Connection

Please advise.



"Tom Ogilvy" wrote:

If the error is just building the string, then perhaps:
Tested from the immediate window:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _
& " AND ((IMR Action Items)='Y')); "



--
Regards,
Tom Ogilvy


"CurtH" wrote in message
...
I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "





  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Compile Error

OK, now i look at it more closely, you need
square brackets round the column names. Try this:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (([UNIT]='125 LOGISTICS READINES SQ')" _
& " AND ([IMR Action Items]='Y')); "



CurtH wrote:
Still same result.

"Andrew Taylor" wrote:

The parentheses aren't balanced in the SQL statement. Delete one of
the three before UNIT.



CurtH wrote:
eThanks for the input. Both options seem toresolve the issue. But, now I
get Run-time error' -2147217900 (80040e14)': Syntax error (missing operator)
in query "(((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR ACTION TEM)='Y'))'.
Once I select debug this line of code is highlighted:
.Open Source:=Src, ActiveConnection:=Connection

Please advise.



"Tom Ogilvy" wrote:

If the error is just building the string, then perhaps:
Tested from the immediate window:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _
& " AND ((IMR Action Items)='Y')); "



--
Regards,
Tom Ogilvy


"CurtH" wrote in message
...
I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "








  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Compile Error

Thanks! That did it. I have oneother question. If I want to select
multiple units or all units. How can I edit the "where" code to do so?

"Andrew Taylor" wrote:

OK, now i look at it more closely, you need
square brackets round the column names. Try this:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (([UNIT]='125 LOGISTICS READINES SQ')" _
& " AND ([IMR Action Items]='Y')); "



CurtH wrote:
Still same result.

"Andrew Taylor" wrote:

The parentheses aren't balanced in the SQL statement. Delete one of
the three before UNIT.



CurtH wrote:
eThanks for the input. Both options seem toresolve the issue. But, now I
get Run-time error' -2147217900 (80040e14)': Syntax error (missing operator)
in query "(((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR ACTION TEM)='Y'))'.
Once I select debug this line of code is highlighted:
.Open Source:=Src, ActiveConnection:=Connection

Please advise.



"Tom Ogilvy" wrote:

If the error is just building the string, then perhaps:
Tested from the immediate window:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _
& " AND ((IMR Action Items)='Y')); "



--
Regards,
Tom Ogilvy


"CurtH" wrote in message
...
I get this compile error with syntax. Code is:

Src = "SELECT * " _
& "FROM MedicalStatus " _
& "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); "







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
VBAProject name compile error, not defined at compile time Matthew Dodds Excel Programming 1 December 13th 05 07:17 PM
error message: compile error, argument not optional Pierre via OfficeKB.com Excel Programming 3 September 5th 05 03:45 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM


All times are GMT +1. The time now is 09:42 PM.

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

About Us

"It's about Microsoft Excel"