Select statement from VBA codes error

F

FA

Hi, I have the following query in my VBA but its giving me error'3001'
Invalid argument. What i am trying to do is run this query and also one
more thing which is i want want the SYS_NME to be appear only once in
the not with every record. Also the parameter that i am trying to pass
is SYS_ID_CODE which is from the from called frmSystem. In this query i
just put SYS_ID_CODE = 109 because i dont know how to pass the
parameter value from the form.

Any body who can help me please

Thanks
strSQL = "SELECT dbo_SYS_INFO.SYS_NME, dbo_SYS_INFO.SYS_URL,
dbo_SYS_INFO.TEST_BEGIN_DATE, dbo_SYS_INFO.TEST_END_DATE," & _
"dbo_FINDG.FINDG_STAT_DATE, dbo_FINDG_STAT.FINDG_STAT, dbo_FINDG.SMRY
AS SMRY, dbo_FINDG.RSK_DESC AS RSK_DESC, dbo_FINDG.RCMN AS RCMN," & _
"dbo_FINDG.FINDG_NO, dbo_FINDG_RSK_LVL.FINDG_RSK_LVL, dbo_FINDG.CMNT AS
CMNT, dbo_FINDG.FINDG_RSK_LVL_ID, dbo_FINDG.FINDG_NME,
dbo_FINDG.PLCY1," & _
"dbo_FINDG.PLCY2, dbo_FINDG.PLCY3, dbo_FINDG.PLCY4, dbo_FINDG.PLCY5,
dbo_FINDG.PLCY6, dbo_FINDG.PLCY7, dbo_FINDG.PLCY8, dbo_FINDG.PLCY9," &
_
"dbo_FINDG.NEW_CMNT AS NEW_CMNT, dbo_FINDG.URL1, dbo_FINDG.URL2,
dbo_FINDG.URL3, dbo_FINDG.URL4, dbo_FINDG.URL5, dbo_FINDG.URL6,
dbo_FINDG.URL7," & _
"dbo_FINDG.URL8, dbo_FINDG.URL9, dbo_SYS_INFO.SYS_ID_CODE FROM
((dbo_SYS_INFO INNER JOIN dbo_FINDG ON
dbo_SYS_INFO.SYS_ID_CODE=dbo_FINDG.SYS_ID_CODE) LEFT JOIN
dbo_FINDG_STAT ON dbo_FINDG.FINDG_STAT_ID=dbo_FINDG_STAT.FINDG_STAT_ID)
LEFT JOIN dbo_FINDG_RSK_LVL ON
dbo_FINDG.FINDG_RSK_LVL_ID=dbo_FINDG_RSK_LVL.FINDG_RSK_LVL_ID WHERE
(((dbo_SYS_INFO.SYS_ID_CODE) = 109))ORDER BY dbo_FINDG.FINDG_RSK_LVL_ID
DESC , dbo_FINDG.FINDG_NO"

Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset Or
dbSeeChanges)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top