Does Orderby effect a Forms' Bookmark ???

R

Roy Frye

I have a continuous form that has a button that opens a
form which contains detailed data. Once the button is
clicked I set the Form's Bookmark to a Global Var(Bmk).
Upon Exiting the Detail Form, the continuous Form is
requeried and its bookmark is reset to the global var, so
the user will be on the appropriate record.
This works fine except when the continuous form is sorted,
using the orderby property. This causes the error: 3159
Invalid Bookmark.

Forms!frmMain!subToDo.Requery
Forms!frmMain!subToDo.Form.Bookmark = Bmk 'Causes Error

Any Ideas???

Thanks
 
W

Wayne Morgan

The requery has the potential to change the bookmarks. Pick a field that has
a unique value for each record and search on the field to move to the record
after the requery.
 
R

Roy Frye

Thanks for the reply Wayne.
I Couldn't get your method to work either. I'm sure that I
did something wrong. However I did get the bookmark to
work by setting the Continuous Form's OrderByOn to False
and then back to True.

Forms!frmmain!subToDo.Form.OrderByOn = False
Forms!frmmain!subToDo.Requery
Forms!frmmain!subToDo.Form.Bookmark = Bmk 'Gbl Bmk Var
Forms!frmmain!subToDo.Form.OrderByOn = True

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top