Controlling row movement in a subform

  • Thread starter Thread starter Rob
  • Start date Start date
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
 
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
 
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
 
Back
Top