VB 6.0 w/ TDBGrid and Bookmark recordset property - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

VB 6.0 w/ TDBGrid and Bookmark recordset property

There is the issue. I have a populated grid that uses ADO to go out to a DB2 table using SQL. The user has the ability to Edit the information with use of an "Edit" button. When the user is done editing the information (which is done on a separate form) they hit OK and it goes out and updates the data and brings the data back to the grid (rebuilding/repopulating). The issue is the user wants the pointer to still be on the record he just edited but when the grid is rebuilt/repopulated it goes back to the first record. I created the following:

varBookmark = f_rst.Bookmark

-- Then the Edit process and the rebuilding of grid

If IsEmpty(varBookmark) Then
varBookmark = f_rst.Bookmark
f_rst.Bookmark = varBookmark
End If

When running it in debug mode and looking at the values of the Bookmark, it holds the value of the correct record. What it doesn't do is move the pointer in the grid to that record, it still points to the first one. GRRR :)

Any help would be greatly appreciated...

Sign In or Register to comment.