Controlling row movement in a subform

R

Rob

Hi all,

I have an issue that I am not sure how to solve. I have a subform
(Datasheet view) that lists milestones associated with a task. When the
user changes the planned date of milestone completion I then add a
reminder to MS Outlook based on a users answer (Yes/No MsgBox - called
in the Forms After_Update event). The problem is that after the MsgBox
is closed (via either Yes or No), the record selector returns to the
first row of the datasheet and not the next row (which is the behaviour
I would like). As there are many milestones attached to some tasks this
behaviour can be annoying.

Should I Bookmark the "edited" record, and the navigate to Bookmark + 1
after the update?

Cheers
Rob
 
J

Jeanette Cunningham

Rob,
Save the current record's PK field on the subform, run the other
code and then find the record with the saved PK.
The code below goes on the subform.

Dim lngPK As Long
lngPK = Me.txtPK
'outlook code here

With Me.RecordsetClone
.FindFirst "PK = " & lngPK
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End If


Jeanette Cunningham -- Melbourne Victoria Australia
 
R

Rob

Hi Jeanette,

Thanks for your reply.

Cheers
Rob

Jeanette said:
Rob,
Save the current record's PK field on the subform, run the other
code and then find the record with the saved PK.
The code below goes on the subform.

Dim lngPK As Long
lngPK = Me.txtPK
'outlook code here

With Me.RecordsetClone
.FindFirst "PK = " & lngPK
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End If


Jeanette Cunningham -- Melbourne Victoria Australia
 

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