PDA

Click to See Complete Forum and Search --> : Deleting Records ADO


Darrenw
Jan 27th, 2000, 01:02 AM
I use the filter property to go to my record
i then use the delete method
However I can still see the record in my bound controls and I am unable to move to another record in the set
I get an Hrow error

Can someone throw some light on this problem please

Glenn
Jan 27th, 2000, 03:10 AM
You need to refresh your record set after a delete. You can't move to another record because your filter condition only returns one record.

Randman
Jan 29th, 2000, 06:33 AM
Originally posted by Darrenw:
I use the filter property to go to my record
i then use the delete method
However I can still see the record in my bound controls and I am unable to move to another record in the set
I get an Hrow error

Can someone throw some light on this problem please


Instead of using the filter why not not use the find method
ex:
Dim varbookmarkd As Variant
data1.recordset.find "id like '" + DataCombo1.Text + "*'"

after the find goes to the record bookmark it
then delete the record. this way your guarenteed the currently bookmarked record is indeed the one to delete.
'bookmark this record
varbookmarkd = DE1.rscmd1.Bookmark
'go to beg of table
DE1.rscmd1.MoveFirst
'go to the bookmarked record
DE1.rscmd1.Bookmark = varbookmarkd
' now delete it
DE1.rscmd1.Delete
'move to last record
de1.rscmd1.movelast
de1.rscmd1.movefirst
' the moves are to counteract with rebinding issues in ado 2.1
I hope this helps