Save Record

  • Thread starter Thread starter Charles
  • Start date Start date
C

Charles

I have a button the user presses that saves the current record they are
working on. The problem is that when they press this button, the record is
saved and then Access jumps to the last record in the database. This nuance
is a pain in the neck. It should stay on the current record. Why it jumps
to the last record is beyond me. Any ideas?

Thank you

Charles
 
Charles said:
I have a button the user presses that saves the current record they
are working on. The problem is that when they press this button, the
record is saved and then Access jumps to the last record in the
database. This nuance is a pain in the neck. It should stay on the
current record. Why it jumps to the last record is beyond me. Any
ideas?

What is the code (or macro) behind the button? Is there code in the
form's AfterUpdate or AfterInsert events? Is the form in DataEntry
mode?
 
I solved the problem with this piece of code:
--
Dim cr As Integer
cr = Me.CurrentRecord
Requery
DoCmd.GoToRecord , , acGoTo, cr
--
Every record has its own ordinal number. In cr variable I've stored that
number, and after Requery, which causes the same behaviour as Your "save
button". And after "jump", last line of code will set focus to the
"CurrentRecord". Try to implement this in Your OnClick event for that
button.
Vojislav Depalov
 
Back
Top