Btw.: would there be another possibility to determine at which record the cursor of the grid is actually pointing?
As I have yet found none, that's how I work around usually, provided my table has an index key field with a unique number (what most tables should have anyway).
I write the SELECT so that the Key field is th first one in the recordset.
When setting the FlexGrid, the key goes to column 0. We can set column 0 width to zero, so we don't see the key value.
When wanting to know the key of the current record where the cursor is on I do:
To delete this current record you can then simply:Code:CurrentKey = Val(flx.TextMatrix(flx.Row, 0))
Also a reference to the Recordset should be kept in a variable when the flex is loaded in the first place likeCode:DBConn.Execute "DELETE FROM myTable WHERE [KeyField]=" & CurrentKey
So to refresh the list you can now do a rsList.ReQuery and Set flxList.DataSource = rsListCode:Private rsList as ADODB.Recordset ... rsList.Open SQLstring, DBConn, adOpenStatic, adLockReadOnly set flxList.DataSource = rsList




Reply With Quote