Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 06-18-2010, 06:33 AM   #1
avtuvy
Registered User
 
Join Date: Jan 2010
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
avtuvy is on a distinguished road
Split form always scrolls to the first record

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

avtuvy is offline   Reply With Quote
Old 06-18-2010, 06:52 AM   #2
boblarson
Smeghead
 
boblarson's Avatar
 
Join Date: Jan 2001
Location: Oregon, USA
Posts: 32,068
Thanks: 97
Thanked 1,828 Times in 1,579 Posts
boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold
Re: Split form always scrolls to the first record

What is the other code on the update button?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
boblarson is offline   Reply With Quote
Old 06-18-2010, 06:52 AM   #3
boblarson
Smeghead
 
boblarson's Avatar
 
Join Date: Jan 2001
Location: Oregon, USA
Posts: 32,068
Thanks: 97
Thanked 1,828 Times in 1,579 Posts
boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold
Re: Split form always scrolls to the first record

Also, do you have any code in the On Current event or After Update event of the form?

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
boblarson is offline   Reply With Quote
Old 06-18-2010, 07:05 AM   #4
avtuvy
Registered User
 
Join Date: Jan 2010
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
avtuvy is on a distinguished road
Re: Split form always scrolls to the first record

Quote:
Originally Posted by boblarson View Post
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

avtuvy is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Requery form and goto specific record based on record from different form Ray Spackman Forms 14 07-05-2009 11:57 AM
New record creation in both main form and subform mhughey Forms 0 05-02-2006 10:50 AM
Sub Form With All Unbound Text Boxes To Store Record Ashfaque Forms 8 12-07-2005 12:46 PM
Print a Form from a Form with the current record of the source form TonyVelasco Forms 12 01-12-2004 10:21 AM
Go to specific record when open form danikuper Forms 0 01-07-2004 08:06 AM




All times are GMT -8. The time now is 06:11 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World