Why doesn't this work?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

db.Execute "DELETE FROM tblMM877R5 " & _
"WHERE (((Left([Field1],7))<>"DELETED" And
(Left([Field1],7))<>"Before" And (Left([Field1],7))<>"ADDED" And
(Left([Field1],7))<>"After")) OR (((Left([Field1],7)) Is Null));"


It highlights the "DELETED" and says Expected end of statement?
 
You must switch out your double-quotes for singles inside your string. This
might be easier to maintain (caution air coding):

db.Execute "DELETE FROM tblMM877R5 " & _
"WHERE Left(Nz([Field1],'DELETED'),7) Not In ('DELETED',
'Before', 'ADDED', 'After');"
 
Back
Top