Split form always scrolls to the first record

avtuvy

Registered User.
Local time
Today, 13:20
Joined
Jan 10, 2010
Messages
39
I do some updates to data displayed on a split form, data is selected on the datasheet view and updated on some text boxes which ar unbound. After I click the update button the datasheet view scrolls to the first record instead of remaining on the record previously selected. I use the code below to keep the focus on the record selected but it does not work.
Code:
With Me.RecordsetClone
                .FindFirst ("[MAP_ID] =" & tmpID)
                If Not .NoMatch Then
                    Me.Bookmark = .Bookmark
                End If
            End With

tmpID is the correct record id in it does execute Me.Bookmark.... but still scrolls to the top, please help
 
Also, do you have any code in the On Current event or After Update event of the form?
 
Also, do you have any code in the On Current event or After Update event of the form?

Code:
ret = MsgBox("You are about to modify a record, do you want to continue", vbYesNo)
        If ret = vbYes Then
            strTemp = "UPDATE dbo_MAP set CROOM_ID=" & Rooms & ",TROOM_ID=" & TRooms & " WHERE dbo_ROOM_MAP.ROOM_MAP_ID=" & Me.roomMapID
            DoCmd.RunSQL strTemp
            With Me.RecordsetClone
                .FindFirst ("[ROOM_MAP_ID] =" & anotheetmp)
                If Not .NoMatch Then
                    Me.Bookmark = .Bookmark
                End If
            End With
        End If

This is the code that I have, _OnCurrent has code which runs after the update button is clicked, even if I comment out that code it it still scrolls up
 

Users who are viewing this thread

Back
Top Bottom