LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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')); "







 
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 04:12 AM.

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

About Us

"It's about Microsoft Excel"