hi,
i am having a problem .i want to delete the record in between the data grid.i am using adodc control.
i am sending the code:
Private Sub delete_Click()
DataGrid1.AllowDelete = True
DataGrid1.AllowUpdate = True
If AdoRs.EOF Then
MsgBox "No more records in the file", , ""
Exit Sub
End If
AdoRs.delete
If Not AdoRs.EOF Then
AdoRs.Update
AdoRs.MoveNext
End If
DataGrid1.Refresh
End Sub
by using this code i am able to delete the first record in the database everytime but i want that as i select some record in between the datagrid with the record selector and press delete it will delete that record from the database
i have also tried the code:
Private Sub delete_Click()
Dim vBm As Variant
If DataGrid1.ApproxCount > 0 Then
For Each vBm In DataGrid1.SelBookmarks
AdoRs.Bookmark = vBm
AdoRs.delete
AdoRs.Update
Next
End If
DataGrid1.Refresh
End Sub
but in that case it gives the error in case of bookmark property of adodc
"this operation is not supported by the provider"
i am using the provider microsoft jet 3.51 provider
can u suggest me the sol.
regards
ishikha
i am having a problem .i want to delete the record in between the data grid.i am using adodc control.
i am sending the code:
Private Sub delete_Click()
DataGrid1.AllowDelete = True
DataGrid1.AllowUpdate = True
If AdoRs.EOF Then
MsgBox "No more records in the file", , ""
Exit Sub
End If
AdoRs.delete
If Not AdoRs.EOF Then
AdoRs.Update
AdoRs.MoveNext
End If
DataGrid1.Refresh
End Sub
by using this code i am able to delete the first record in the database everytime but i want that as i select some record in between the datagrid with the record selector and press delete it will delete that record from the database
i have also tried the code:
Private Sub delete_Click()
Dim vBm As Variant
If DataGrid1.ApproxCount > 0 Then
For Each vBm In DataGrid1.SelBookmarks
AdoRs.Bookmark = vBm
AdoRs.delete
AdoRs.Update
Next
End If
DataGrid1.Refresh
End Sub
but in that case it gives the error in case of bookmark property of adodc
"this operation is not supported by the provider"
i am using the provider microsoft jet 3.51 provider
can u suggest me the sol.
regards
ishikha