Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bookmark Synch Problem

Status
Not open for further replies.

bbrendan

IS-IT--Management
Dec 13, 2001
109
GB
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
 
change this:

frmMain.TDBGridTblTitle.Bookmark = frmMain.TDBGridTblTitle.SelBookmarks(0)

to this:

frmMain.TDBGridTblTitle.Bookmarks.Add frmMain.TDBGridTblTitle.Bookmark

HTH

AMACycle
 
hi AMACycle

Thanks for your reply but this doesnt help. the property you have stated doiesnt exist!

 
Interesting. Here's a code snippet that works in a datagrid I have:

If dtRacers.SelBookmarks.Count > 0 Then
dtRacers.SelBookmarks.Remove 0
End If
dtRacers.SelBookmarks.Add dtRacers.Bookmark

Grant it, the expression in question is after the "IF" statement, but would that make a difference? I wonder.

AMACycle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top