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  

How To Move To Last Record in Form



 
 
Thread Tools Display Modes
  #1  
Old November 6th, 2009, 11:57 PM posted to microsoft.public.access.forms
Gary
external usenet poster
 
Posts: 790
Default 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  
Old November 7th, 2009, 12:22 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old November 7th, 2009, 04:38 AM posted to microsoft.public.access.forms
Beetle
external usenet poster
 
Posts: 1,254
Default 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

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 12:59 PM.


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