A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Moving off and back onto a record



 
 
Thread Tools Display Modes
  #1  
Old October 21st, 2005, 11:09 AM
P
external usenet poster
 
Posts: n/a
Default 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  
Old October 21st, 2005, 11:47 AM
Arvin Meyer [MVP]
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:15 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.