Delete row in table by code

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

Guest

I have a table named Uploaded Documents that is created by a code that was
developed by someone that used to work here. I have no coding experience so
need some help. I need to add something to the end of his code that would
delete any row where in the field SVBrand it contains either ## or @@
anywhere in that field. Any help would be apprectiated.
 
Put this in the code and it will delete those rows:

strSQL = "DELETE * FROM [Uploaded Documents] WHERE svBrand = '##' OR
svBrand '@@';"
CurrentDb.Execute(strSQL), dbFailOnError
 
Supe said:
I have a table named Uploaded Documents that is created by a code that was
developed by someone that used to work here. I have no coding experience so
need some help. I need to add something to the end of his code that would
delete any row where in the field SVBrand it contains either ## or @@
anywhere in that field.


Make sure you have a backup copy of the table just in case
Murphy looks over your shoulder ;-)

CurrentDb.Ececute "DELETE [Uploaded Documents].* " _
& "WHERE SVBrand Like '*@@*' " _
& "OR SVBrand Like '*[#][#]*' "
 
Back
Top