C
Crystal
I'm running this code:
strSQL = "INSERT INTO tblScheduleMonitor ( StockNo," & _
"ProductName, FamCode )" & _
"SELECT qryFlyFamily.Stock," & _
" qryFlyFamily.[Product Name]," & _
" qryFlyFamily.FamCode" & _
" FROM qryFlyFamily LEFT JOIN tblScheduleMonitor ON " & _
" qryFlyFamily.Stock = tblScheduleMonitor.StockNo" & _
" WHERE (((qryFlyFamily.FamCode)=""" & strFamCode &_
"""" & ") AND ((tblScheduleMonitor.StockNo) Is Null));"
db.Execute strSQL, dbFailOnError
MsgBox db.RecordsAffected
If I run this code, the query does not append any records
to the table. If I run this as a query, it works. Any
ideas as to why it refuses to work in code?
Crystal
strSQL = "INSERT INTO tblScheduleMonitor ( StockNo," & _
"ProductName, FamCode )" & _
"SELECT qryFlyFamily.Stock," & _
" qryFlyFamily.[Product Name]," & _
" qryFlyFamily.FamCode" & _
" FROM qryFlyFamily LEFT JOIN tblScheduleMonitor ON " & _
" qryFlyFamily.Stock = tblScheduleMonitor.StockNo" & _
" WHERE (((qryFlyFamily.FamCode)=""" & strFamCode &_
"""" & ") AND ((tblScheduleMonitor.StockNo) Is Null));"
db.Execute strSQL, dbFailOnError
MsgBox db.RecordsAffected
If I run this code, the query does not append any records
to the table. If I run this as a query, it works. Any
ideas as to why it refuses to work in code?
Crystal