BvCF
MIS
- Nov 11, 2006
- 92
- 0
- 0
Having a syntax error , missing operator in query expression, for the following code.
When debugging, the lines after "CurrentDb.Execute "Update tblVar..." is highlighted.
Any insight as to what I am missing would be greatly appreciated.
Function UpdateAccess()
CurrentDb.Execute "DELETE * FROM tblUpdateTemp"
CurrentDb.Execute "INSERT INTO tblUpdateTemp (VIDCurrent, AcctNo, Type, Date, " & _
"State, DateBilled, TotChgCurrent, ExpReimbCurrent, TotInsPymtsCurrent, TotPymts, BalanceCurrent," & _
"RemitCharges,MasAllowCurrent, CoNo, VarianceCurrent) Select VIDCurrent , AcctNo, Type," & _
"Date, State, DateBilled, TotChgCurrent, ExpReimbCurrent, TotInsPymtsCurrent," & _
"TotPymts, BalanceCurrent, RemitCharges, MasAllowCurrent, CoNo, VarianceCurrent FROM qrySQLPassthru_Update;"
CurrentDb.Execute "UPDATE tblVar INNER JOIN tblUpdateTemp ON tblVar.AcctNo = tblUpdateTemp.AcctNo" & _
"SET tblVar.VIDCurrent = tblUpdateTemp.VIDCurrent, tblVar.Type = tblUpdateTemp.Type, " & _
"tblVar.Date = tblUpdateTemp.Date, " & _
"tblVar.State = tblUpdateTemp.State, tblVar.DateBilled = tblUpdateTemp.DateBilled," & _
"tblVar.TotChgCurrent = tblUpdateTemp.TotChgCurrent, tblVar.ExpReimbCurrent = tblUpdateTemp.ExpReimbCurrent, " & _
"tblVar.TotInsPymtsCurrent = tblUpdateTemp.TotInsPymtsCurrent, tblVar.TotPymts = tblUpdateTemp.TotPymts," & _
"tblVar.BalanceCurrent = tblUpdateTemp.BalanceCurrent, tblVar.RemitCharges = tblUpdateTemp.RemitCharges," & _
"tblVar.MasAllowCurrent = tblUpdateTemp.MasAllowCurrent, tblVar.CoNo = tblUpdateTemp.CoNo, " & _
"tblVar.VarianceCurrent = tblUpdateTemp.VarianceCurrent, tblVar.DateEncUpdated = Now() "
End Function
When debugging, the lines after "CurrentDb.Execute "Update tblVar..." is highlighted.
Any insight as to what I am missing would be greatly appreciated.
Function UpdateAccess()
CurrentDb.Execute "DELETE * FROM tblUpdateTemp"
CurrentDb.Execute "INSERT INTO tblUpdateTemp (VIDCurrent, AcctNo, Type, Date, " & _
"State, DateBilled, TotChgCurrent, ExpReimbCurrent, TotInsPymtsCurrent, TotPymts, BalanceCurrent," & _
"RemitCharges,MasAllowCurrent, CoNo, VarianceCurrent) Select VIDCurrent , AcctNo, Type," & _
"Date, State, DateBilled, TotChgCurrent, ExpReimbCurrent, TotInsPymtsCurrent," & _
"TotPymts, BalanceCurrent, RemitCharges, MasAllowCurrent, CoNo, VarianceCurrent FROM qrySQLPassthru_Update;"
CurrentDb.Execute "UPDATE tblVar INNER JOIN tblUpdateTemp ON tblVar.AcctNo = tblUpdateTemp.AcctNo" & _
"SET tblVar.VIDCurrent = tblUpdateTemp.VIDCurrent, tblVar.Type = tblUpdateTemp.Type, " & _
"tblVar.Date = tblUpdateTemp.Date, " & _
"tblVar.State = tblUpdateTemp.State, tblVar.DateBilled = tblUpdateTemp.DateBilled," & _
"tblVar.TotChgCurrent = tblUpdateTemp.TotChgCurrent, tblVar.ExpReimbCurrent = tblUpdateTemp.ExpReimbCurrent, " & _
"tblVar.TotInsPymtsCurrent = tblUpdateTemp.TotInsPymtsCurrent, tblVar.TotPymts = tblUpdateTemp.TotPymts," & _
"tblVar.BalanceCurrent = tblUpdateTemp.BalanceCurrent, tblVar.RemitCharges = tblUpdateTemp.RemitCharges," & _
"tblVar.MasAllowCurrent = tblUpdateTemp.MasAllowCurrent, tblVar.CoNo = tblUpdateTemp.CoNo, " & _
"tblVar.VarianceCurrent = tblUpdateTemp.VarianceCurrent, tblVar.DateEncUpdated = Now() "
End Function