I have a form with MSFlexgrid control and a button [edit/delete].
(The data is stored in an Access file if that matters)
The button calls a 2nd Edit form where the user views the selected record.
I run a 2nd recordset to pull just the one selected row in the MsFlexgrid Control to feed this screen. All data displays fine here.
From here they have a [Save] button and [Delete] button on the form.
I have the editing working great using ADO. (.update).
But, when I use the Delete button, the record is deleted from the Access Table, but still shows up on the MSFlexgrid after "Unloading" the edit form.
Here is the code for "pulling" the one record for the Edit/Delete screen:
Code:strWhere = " where SUVC = " & strSUVC & " AND " & _ "SF = " & strSF & " AND " & _ "CLN = " & strCln strSql = "Select * from VendorMaster" & strWhere Set rstESupplier = New ADODB.Recordset With rstESupplier .CursorType = adOpenKeyset .CursorLocation = adUseClient .LockType = adLockOptimistic .Open strSql, adoActiveConnection .MoveFirst End With
For the delete button, the following code is used:
I have tried using ".MoveNext" , ".Requery", ".Update" after .Delete, but none work.Code:With rstESupplier .Delete End With
I call the same function (Update Grid) after ".Delete" that I do when I load the original form with the MSFlexGrid.
If I close the Form with the MSFlexgrid control and then go back to into it, the data is refreshed. The Deleted record is gone.
What additional things do I need to do when "deleting" a record?
Thanks.




Reply With Quote