Delete row in table by code

S

Supe

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.
 
K

Klatuu

Put this in the code and it will delete those rows:

strSQL = "DELETE * FROM [Uploaded Documents] WHERE svBrand = '##' OR
svBrand '@@';"
CurrentDb.Execute(strSQL), dbFailOnError
 
M

Marshall Barton

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 '*[#][#]*' "
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top