Hello,
I am error 3075 error in my strSQL statement and I was hoping I could get some assistance to finding where my error is. I have tried many different combinations with no luck. I copied and pasted the original code from a query that is working. Any help is appreciated. Tom
I am error 3075 error in my strSQL statement and I was hoping I could get some assistance to finding where my error is. I have tried many different combinations with no luck. I copied and pasted the original code from a query that is working. Any help is appreciated. Tom
Code:
'Original code from query
SELECT DAT_Refunds.uci, TMP_Pats.PatName, TMP_Pats.AcctNu, DAT_Refunds.eid, DAT_Refunds.slid, DAT_Refunds.tid, DAT_Refunds.postdttran, TMP_Dpt.dptdesc, TMP_Prov.provdesc, TMP_Fac.facdesc, DAT_Refunds.curinsmne, DAT_Refunds.cpt, DAT_Refunds.comp, DAT_Refunds.amt, DAT_Refunds.doschg, DAT_Refunds.chgamt, DAT_Refunds.priminsmne, DAT_Refunds.ticketnum
FROM (((DAT_Refunds LEFT JOIN TMP_Prov ON DAT_Refunds.prov = TMP_Prov.provid) LEFT JOIN TMP_Pats ON DAT_Refunds.aid = TMP_Pats.aid) LEFT JOIN TMP_Dpt ON DAT_Refunds.dpt = TMP_Dpt.dptid) LEFT JOIN TMP_Fac ON DAT_Refunds.fac = TMP_Fac.facid
ORDER BY TMP_Pats.PatName, TMP_Dpt.dptdesc, DAT_Refunds.cpt;
'strSQL statement
strSQL = "SELECT DAT_Refunds.uci, TMP_Pats.PatName, TMP_Pats.AcctNu, DAT_Refunds.eid, DAT_Refunds.slid, DAT_Refunds.tid, DAT_Refunds.postdttran, " & _
"TMP_Dpt.dptdesc, TMP_Prov.provdesc, TMP_Fac.facdesc, DAT_Refunds.curinsmne,DAT_Refunds.cpt, DAT_Refunds.comp, DAT_Refunds.amt, " & _
"DAT_Refunds.doschg, DAT_Refunds.chgamt, DAT_Refunds.priminsmne, DAT_Refunds.ticketnum " & _
"FROM DAT_Refunds " & _
"LEFT JOIN TMP_Prov ON DAT_Refunds.prov = TMP_Prov.provid " & _
"LEFT JOIN TMP_Pats ON DAT_Refunds.aid = TMP_Pats.aid " & _
"LEFT JOIN TMP_Dpt ON DAT_Refunds.dpt = TMP_Dpt.dptid " & _
"LEFT JOIN TMP_Fac ON DAT_Refunds.fac = TMP_Fac.facid" & _
"ORDER BY TMP_Pats.PatName, TMP_Dpt.dptdesc, DAT_Refunds.cpt;"
debug.print output
SELECT DAT_Refunds.uci, TMP_Pats.PatName, TMP_Pats.AcctNu, DAT_Refunds.eid, DAT_Refunds.slid, DAT_Refunds.tid, DAT_Refunds.postdttran, TMP_Dpt.dptdesc, TMP_Prov.provdesc, TMP_Fac.facdesc, DAT_Refunds.curinsmne,DAT_Refunds.cpt, DAT_Refunds.comp, DAT_Refunds.amt, DAT_Refunds.doschg, DAT_Refunds.chgamt, DAT_Refunds.priminsmne, DAT_Refunds.ticketnum FROM DAT_Refunds LEFT JOIN TMP_Prov ON DAT_Refunds.prov = TMP_Prov.provid LEFT JOIN TMP_Pats ON DAT_Refunds.aid = TMP_Pats.aid LEFT JOIN TMP_Dpt ON DAT_Refunds.dpt = TMP_Dpt.dptid LEFT JOIN TMP_Fac ON DAT_Refunds.fac = TMP_Fac.facidORDER BY TMP_Pats.PatName, TMP_Dpt.dptdesc, DAT_Refunds.cpt;