Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting a record from Access data base using programming from excel


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

--
dipa
-----------------------------------------------------------------------
dipak's Profile: http://www.excelforum.com/member.php...fo&userid=2818
View this thread: http://www.excelforum.com/showthread.php?threadid=47710

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Deleting a record from Access data base using programming from exc

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 = ______ ";

"dipak" wrote:


Hello,

I have some program written in MS excel macro. And from there I am
trying to delete a record with a condition from a MS Access database. I
am not been able to get the code right. Can any one help me with sample
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 the
Salary table.

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

Regards,
Dipak


--
dipak
------------------------------------------------------------------------
dipak's Profile: http://www.excelforum.com/member.php...o&userid=28181
View this thread: http://www.excelforum.com/showthread...hreadid=477102


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel user enter a store # to query Access data base liem Excel Discussion (Misc queries) 0 January 16th 10 03:45 AM
Chart connected to an Access data base Maracay Charts and Charting in Excel 2 December 4th 08 02:12 AM
Access data base is able to store any number of records clearcell Excel Worksheet Functions 0 November 8th 05 08:45 PM
Transfer Data from Excel 2000 to the Access data base André Lavoie Excel Programming 1 September 28th 05 03:22 PM
Import data from Access Data Base Kelly[_3_] Excel Programming 2 August 20th 03 12:44 AM


All times are GMT +1. The time now is 08:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"