Im just a little stuck with some code.
I have a grid which I populate and can update fine using the .selbookmarks.
But say for exmaple I re-sort this grid then try an use the .selbookmark property. It still holds the old bookmark position instead of the new re-sorted position
For example. Before resort Product was at position 10
After resort product is now at position 5. But the .selbookmark property still holds the old bookmark position of 10
Essentially I would like to reset the row bookmarks aftre the datagrid has been re-sorted
---------------------------------------------------------
Do While frmMain.TDBGridTblTitle.SelBookmarks.Count <> 0
frmMain.TDBGridTblTitle.Bookmark = frmMain.TDBGridTblTitle.SelBookmarks(0)
With oRSTitle
.Find "ISBN ='" & frmMain.TDBGridTblTitle.Columns("ISBN").Value & "'"
.Fields("product_category") = TDBGridCategory.Columns("product_category").Value
.Fields("product_segment") = TDBGridCategory.Columns("product_segment").Value
.Update
End With
If frmMain.TDBGridTblTitle.SelBookmarks.Count > 0 Then
frmMain.TDBGridTblTitle.SelBookmarks.Remove 0
End If
Loop
any tips would be great!!
thanks
I have a grid which I populate and can update fine using the .selbookmarks.
But say for exmaple I re-sort this grid then try an use the .selbookmark property. It still holds the old bookmark position instead of the new re-sorted position
For example. Before resort Product was at position 10
After resort product is now at position 5. But the .selbookmark property still holds the old bookmark position of 10
Essentially I would like to reset the row bookmarks aftre the datagrid has been re-sorted
---------------------------------------------------------
Do While frmMain.TDBGridTblTitle.SelBookmarks.Count <> 0
frmMain.TDBGridTblTitle.Bookmark = frmMain.TDBGridTblTitle.SelBookmarks(0)
With oRSTitle
.Find "ISBN ='" & frmMain.TDBGridTblTitle.Columns("ISBN").Value & "'"
.Fields("product_category") = TDBGridCategory.Columns("product_category").Value
.Fields("product_segment") = TDBGridCategory.Columns("product_segment").Value
.Update
End With
If frmMain.TDBGridTblTitle.SelBookmarks.Count > 0 Then
frmMain.TDBGridTblTitle.SelBookmarks.Remove 0
End If
Loop
any tips would be great!!
thanks