bookmark problem

A

Andreas Wöckl

Hi!

I have the following problem in my access form:

for example I use a form to display overview data (all employes of a
company) - with a button I go to a detail mode to edit the data - when i
close this form i want to

1.) refresh the overview
2.) set a bookmark to go to the data sentence I have edited

my code on closing the form:

Public Sub reloadForm(ByVal formName)
If IsLoaded(formName) Then
Forms(formName).Bookmark.requery
Forms(formName).Bookmark = globBookmark
End If
End Sub

Without doing the requery I am able to go to de sentence - but the data is
not refreshed..

Can anyone help me?

best regards,

andreas wöckl
 
A

Adrian Jansen

I found out the hard way that the requery wrecks your bookmarks. The best
way appears to be to save the current ID, eg the primary key for the record,
then do a FindFirst on the form recordsetclone to go back to the same ID.
And you still have to handle the case where that record was deleted, in
which case the Find fails.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 

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