PDA

Click to See Complete Forum and Search --> : Deleting a record from an ADO recordset


Spooked
Jun 15th, 2000, 10:17 PM
Please help..

I have used a datagrid to display records from an ADO recordset. What I need to be able to do is delete the currently selected record from the recordset.

I have used the following code to determine the record the user has selected:

DieSelected = datagridBookInDieNew.Columns("Order_ID").CellValue(datagridBookInDieNew.Bookmark)

The selected record is then transferred into another table but I need to be able to delete it from the table it was in..

Any help greatly appreciated

JHausmann
Jun 15th, 2000, 11:15 PM
The ADO recordset object has a delete method, you just need to make sure that the recordset is pointing to the row you want to delete.

recordset.Delete adAffectCurrent ' deletes current record
recordset.Delete adAffectGroup 'deletes records that satisfy the current fiter property setting