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
|
|||
|
|||
How To Move To Last Record in Form
I have a form which is bounded to a table. I have a button on the form
which will add 7 addition records to the table and update the table of the form. After clicking on the button to add the 7 records, the number of records increase by 7 in the form. That works - no issue. The problem I have is after clicking on the button and when it completes, the record on the form resets back to the 1st record. I would like to advance to to the last record. I have tried the following: 1) DoCmd GoToRecord , , ac_Last This will work on the "On Activate" event. When the form opens it will be at the last record of the table in the form. It doesn't work if add that in the button VBA code at the end. 2) If I add the "DoCmd GoToRecord , , ac_last" to a text box in the "got focus" even, it will move to the last record. I need help to move the last record after click on my button. Can someone help ? Thanks, Gary P.S. Using Access 2000-03 with XP Pro OS |
#2
|
|||
|
|||
How To Move To Last Record in Form
On Fri, 6 Nov 2009 15:57:01 -0800, Gary
wrote: I need help to move the last record after click on my button. Ummmm... put the line in the click event of the button (after the requery). -- John W. Vinson [MVP] |
#3
|
|||
|
|||
How To Move To Last Record in Form
Try using the RecordsetClone and Bookmark properties.
With Me.RecordsetClone .MoveLast Me.Bookmark = .Bookmark End With -- _________ Sean Bailey "Gary" wrote: I have a form which is bounded to a table. I have a button on the form which will add 7 addition records to the table and update the table of the form. After clicking on the button to add the 7 records, the number of records increase by 7 in the form. That works - no issue. The problem I have is after clicking on the button and when it completes, the record on the form resets back to the 1st record. I would like to advance to to the last record. I have tried the following: 1) DoCmd GoToRecord , , ac_Last This will work on the "On Activate" event. When the form opens it will be at the last record of the table in the form. It doesn't work if add that in the button VBA code at the end. 2) If I add the "DoCmd GoToRecord , , ac_last" to a text box in the "got focus" even, it will move to the last record. I need help to move the last record after click on my button. Can someone help ? Thanks, Gary P.S. Using Access 2000-03 with XP Pro OS |
Thread Tools | |
Display Modes | |
|
|