hello,
I have this Delete function that works well with deleting any items in 3 of my 4 Listx SSDBGrid.
Listx(0) SSDBGrid <~~ no problem deleting
Listx(1) SSDBGrid <~~ no problem deleting
Listx(2) SSDBGrid <~~ when I delete an item off the DataGrid I got an error message," Run-tme error '3426': This action was cancelled by an associated object." When I clicked Ok on the error message, it points to 'Datax(tx).Recordset.MoveNext' (see below). I have put debug lines to see what has been catching it. It is pointing to tx1 = Customer, which is Ok, but no debug output on tx2.
and Listx(3) SSDBGrid <~~ no problem deleting
My question is , the same piece of code delete without errors in the other 3 DBGrids but NOT when deleting Listx(2) SSDBGrid.
Any suggestions?
Thanks,
Ann
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub cmdDelete_Click()
If txtID(tx) = "" Then Exit Sub
If MsgBox("Delete Item " & txtID(tx) & "?", 36) = 6 Then
Datax(tx).Recordset.Delete
MsgBox (" Datax(tx)1 = " & Datax(tx))
Datax(tx).Recordset.MoveNext
MsgBox (" Datax(tx)2 = " & Datax(tx))
If Datax(tx).Recordset.EOF = True Then
If Datax(tx).Recordset.RecordCount <> 0 Then
Datax(tx).Recordset.MoveFirst
End If
End If
End If
End Sub
I have this Delete function that works well with deleting any items in 3 of my 4 Listx SSDBGrid.
Listx(0) SSDBGrid <~~ no problem deleting
Listx(1) SSDBGrid <~~ no problem deleting
Listx(2) SSDBGrid <~~ when I delete an item off the DataGrid I got an error message," Run-tme error '3426': This action was cancelled by an associated object." When I clicked Ok on the error message, it points to 'Datax(tx).Recordset.MoveNext' (see below). I have put debug lines to see what has been catching it. It is pointing to tx1 = Customer, which is Ok, but no debug output on tx2.
and Listx(3) SSDBGrid <~~ no problem deleting
My question is , the same piece of code delete without errors in the other 3 DBGrids but NOT when deleting Listx(2) SSDBGrid.
Any suggestions?
Thanks,
Ann
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub cmdDelete_Click()
If txtID(tx) = "" Then Exit Sub
If MsgBox("Delete Item " & txtID(tx) & "?", 36) = 6 Then
Datax(tx).Recordset.Delete
MsgBox (" Datax(tx)1 = " & Datax(tx))
Datax(tx).Recordset.MoveNext
MsgBox (" Datax(tx)2 = " & Datax(tx))
If Datax(tx).Recordset.EOF = True Then
If Datax(tx).Recordset.RecordCount <> 0 Then
Datax(tx).Recordset.MoveFirst
End If
End If
End If
End Sub