I am getting the runtime error 3061 on an strSQL statement. I have been working on this all day and I have come up blank on why I am getting this error. I am hoping to get some help.
The debug statement results are:
INSERT INTO CONS_Rejections (uci,RptPd,SvcPd,AID,EncID,TranID,RevCode,ReviewDt,ReviewComment) SELECT SPN AS u,dbo_bi_Rejections.revpd,dbo_bi_Rejections.svcpd,dbo_bi_Rejections.aid,dbo_bi_Rejections.eid,dbo_bi_Rejections.slid,dbo_bi_Rejections.revcode,dbo_bi_Rejections.revdate,dbo_bi_Rejections.revcomment FROM dbo_bi_Rejections WHERE dbo_bi_Rejections.revpd>373 AND dbo_bi_Rejections.clntid=97;
Tom
The debug statement results are:
INSERT INTO CONS_Rejections (uci,RptPd,SvcPd,AID,EncID,TranID,RevCode,ReviewDt,ReviewComment) SELECT SPN AS u,dbo_bi_Rejections.revpd,dbo_bi_Rejections.svcpd,dbo_bi_Rejections.aid,dbo_bi_Rejections.eid,dbo_bi_Rejections.slid,dbo_bi_Rejections.revcode,dbo_bi_Rejections.revdate,dbo_bi_Rejections.revcomment FROM dbo_bi_Rejections WHERE dbo_bi_Rejections.revpd>373 AND dbo_bi_Rejections.clntid=97;
Tom
Code:
strSQL = "INSERT INTO CONS_Rejections (uci,RptPd,SvcPd,AID,EncID,TranID,RevCode,ReviewDt,ReviewComment) " & _
"SELECT " & strUCI & " AS u" & ",dbo_bi_Rejections.revpd,dbo_bi_Rejections.svcpd,dbo_bi_Rejections.aid,dbo_bi_Rejections.eid," & _
"dbo_bi_Rejections.slid,dbo_bi_Rejections.revcode,dbo_bi_Rejections.revdate,dbo_bi_Rejections.revcomment " & _
"FROM dbo_bi_Rejections " & _
"WHERE dbo_bi_Rejections.revpd>" & iFyStart & " AND dbo_bi_Rejections.clntid=" & iClid & ";"
Debug.Print strSQL
CurrentDB.Execute strSQL