If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Moving off and back onto a record
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. |
#2
|
|||
|
|||
Moving off and back onto a record
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 "P" wrote in message ... 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. |
Thread Tools | |
Display Modes | |
|
|