removing records from a table in Access

Posted on 2000-02-01
Medium Priority
Last Modified: 2010-05-02
I have a table within an access database.
This table contains 3 columns\fields
What I want to do in my vb app is remove any records where the 2nd and 3rd column\field value are equal
Let's say my table looks like this

Cell1 cell2 cell3
aaaaa new   old
bbbbb old   old
ccccc old   new

So I want to remove the second record because old = old

Any help appreciated
Question by:PaulBlack
1 Comment

Accepted Solution

samopal earned 200 total points
ID: 2478995
Dim cn as new ADODB.Connection
Dim rs as New ADODB.Recordset

cn.open .......
rs.open "Delete from myTable where cell2=cell3",cn


Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question