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

Greetings!

I have a form where a user can select a field (Group Name) and after
pressing OK it should show some records.

The code I have doesn't run because I get "Compile Error: Syntax Error". The
SQL string in the VBA Macro is (got it with Macro Recorder):


..CommandText = Array( _
"SELECT Groups.`Group Name`, `Flown Revenue 2005`.`Agent Code`, Sum(`Flown
Revenue 2005`.Coupons) as [Cpns]" & Chr(13) & "" & Chr(10) & "FROM {oj `C:\My
Documents\Temporário\Unify\db2006 November-onward Compact`.`Flown Revenue 20"
_
, _
"05` `Flown Revenue 2005` LEFT OUTER JOIN `C:\My
Documents\Temporário\Unify\db2006 November-onward Compact`.Groups Groups ON
`Flown Revenue 2005`.`Agent Code` = Groups.`Agent Code`}" & Chr(13) & "" &
Chr(10) & "WHERE Groups.`Group Name`" & " = " & cmdComboBox.Text &" Chr(13) &
"" & Chr(10) & "GROUP BY Groups.`G" _
, "roup Name`, `Flown Revenue 2005`.`Agent Code`")


I can't see where is the Syntax Error.

Please help
Thanks!
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
syntax error Nigel[_27_] Excel Programming 3 November 15th 06 10:26 PM
runtime error: syntax error or access violation oucsester[_2_] Excel Programming 1 May 3rd 06 05:51 PM
runtime error: syntax error or access violation oucsester Excel Programming 0 May 3rd 06 02:22 PM
variable not declared error & syntax error G. Beard Excel Programming 1 October 6th 05 09:16 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM


All times are GMT +1. The time now is 09:40 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"