Has anyone a definitive answer as to how to get a MSHFlexGrid to refresh properly and show updated information? There’s a lot of stuff about this returned from Google but no-one seems to have a real answer.
I use a MSHFlexGrid to show a recordset in VB6 (so use Datasource set to a data environment, then the Datamember set to a simple ‘SELECT * FROM documents ORDER BY a, b’; nothing fancy), and allow the user to click on any row which gets them into a separate screen where one option is to delete a record. This goes ok (I’ve set breakpoints and can verify that it does delete) but when I reactivate the form with the flex grid, the deleted record still shows, despite coding the following (in the form’s Activate event):
With de1.rstDocuments1
If .State = adStateOpen Then .Close
.Open
.Requery
.Close
End With
With flex1
.Clear
Set .DataSource = DataEnvironment1
.DataMember = “tDocuments1”
.Refresh
End With
I think the above is fairly clear; the actual names etc are correct. So I’ve closed and requeried the actual query, cleared and reset the grid, then used Refresh, but still to no avail! Does anyone have any idea what’s wrong or missing or what? This also happens if I add a new record first then show the form with the flex grid – i.e. no new record shows!
Thanks.