Moving off and back onto a record

  • Thread starter Thread starter P
  • Start date Start date
P

P

Hi,

I have a small issue with subforms (see previous post 'Subform not showing
correct data').

We have a manual workaround of the subform not showing the correct data - if
we move to the previous record in the subform (using the navigation
buttons), then back again, it shows the correct data.

Is there any way of performing this action in code, so that the user doesn't
have to do it?

Regards

Pete.
 
Try something like this in the form's AfterUpdate event:

Private Sub Form_AfterUpdate()
Dim lngID As Long
lngID = Me.IDField
Me.Requery
With .RecordsetClone
.FindFirst "[IDField]=" & lngID
If .NoMatch Then
.MoveFirst
End If
End With
Me.Bookmark = .RecordsetClone.Bookmark
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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

Back
Top