Deleting a record from Access data base using programming from excel

  • Thread starter Thread starter dipak
  • Start date Start date
D

dipak

Hello,

I have some program written in MS excel macro. And from there I a
trying to delete a record with a condition from a MS Access database.
am not been able to get the code right. Can any one help me with sampl
code please.
My scenario would be as follows:

I have a Employee salary table having feilds as EMPNO, Month and SAL.

Now with my current code all the records are getting deleted from th
Salary table.

I would like to delete the record of a particular employee from th
salary table. But I am not been able to provide the option EMPNo in m
delete statement.

Regards,
Dipa
 
Generically - use delete instead of select

whatever records would have been returned by select will be deleted

With the DB open, since you are deleting the record you do not need anything
between DELETE and FROM:

CurrentDb.Execute "DELETE FROM MyTable WHERE EMPNO = ______ ";
 

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

Back
Top