Bookmark a continuous form

G

Guest

I've tried looking at other posts on this but actually think they are more
complicated than I require as most are using subforms.

I have a continuous form and against each record is an edit button which
opens a single form for the prupose of editing. This form is opened in
dialog and the main form requeries when I close the dialog form.

However I want to bookmark the record in the original form. There is an ID
(not visible) in both froms and this, I assume, is the control to use, if
only I knew how!

My code on the edit button in the main form is this:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Receipts Detail E"

stLinkCriteria = "[RDID]=" & Me![RDID]
DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog
Me.Requery

Can anyone tell me what additional code I need and where it should sit?

I am using Access 2003 and would be grateful of any help.
 
A

Albert D. Kallal

This form is opened in
dialog and the main form requeries when I close the dialog form.

Are you sure you need to requery the form?

You could like use a me.Refresh. By the way, if you allow editing in the
continues form, then you need for force a disk write BEFORE you launch
another form that edits the same record (else, you will have two forms open
with pending writes to the same record, and will get that "someone else has
changed the record...bla bal bal. That someone else is the other form!!!).

So,
However I want to bookmark the record in the original form.

The instant you execute a requery, then all bookmarks are invalid.

So, you are correct, you need to grab the id...

Try this:

dim lngPos as long


.....
.....

me.Refresh ' <-- force a disk write
DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog

lngPos = Me.Recordset.AbsolutePosition '<-- save postion
Me.Requery
Me.Recordset.AbsolutePosition = lngPos ' <-- restore postion
 
G

Guest

Thanks very much Albert, just what I needed.

Albert D. Kallal said:
Are you sure you need to requery the form?

You could like use a me.Refresh. By the way, if you allow editing in the
continues form, then you need for force a disk write BEFORE you launch
another form that edits the same record (else, you will have two forms open
with pending writes to the same record, and will get that "someone else has
changed the record...bla bal bal. That someone else is the other form!!!).

So,


The instant you execute a requery, then all bookmarks are invalid.

So, you are correct, you need to grab the id...

Try this:

dim lngPos as long


.....
.....

me.Refresh ' <-- force a disk write
DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog

lngPos = Me.Recordset.AbsolutePosition '<-- save postion
Me.Requery
Me.Recordset.AbsolutePosition = lngPos ' <-- restore postion
 

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