Hi,
The below query works fine in sql view of the query design mode, but when I try to copy that sql statement to a form so i can execute the query from code it says it's an invalid string and won't let me continue (highlights the whole statement in red)
Here it is below:
strSQLOrd = "SELECT First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeLD] <> 'Null'"
) AS [LD Orders], " _
& "First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeTF] <> 'Null'"
) AS [TF Orders], " _
& "First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeTF] = 'SWNE'"
) AS [SWNE], " _
& "First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeTF] = 'SWPO'"
) AS [SWPO], " _
& "First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeFC] <> 'Null'"
) AS [CC Orders], " _
& "First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeDal] <> 'Null'"
) AS [Dal Orders] " _
& "FROM TblGbmMaster;"
I think i'm prolly missing extra quotes or double quotes in various places so VBA thinks it's NOT a valid continuous string
I would really appreciate it if someone can help me out.
Thanks in advance,
THEGREEK
The below query works fine in sql view of the query design mode, but when I try to copy that sql statement to a form so i can execute the query from code it says it's an invalid string and won't let me continue (highlights the whole statement in red)
Here it is below:
strSQLOrd = "SELECT First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeLD] <> 'Null'"
& "First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeTF] <> 'Null'"
& "First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeTF] = 'SWNE'"
& "First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeTF] = 'SWPO'"
& "First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeFC] <> 'Null'"
& "First(DCount('[GbmID]','tblGbmMaster',"[ClassCodeDal] <> 'Null'"
& "FROM TblGbmMaster;"
I think i'm prolly missing extra quotes or double quotes in various places so VBA thinks it's NOT a valid continuous string
I would really appreciate it if someone can help me out.
Thanks in advance,
THEGREEK