form NOT to update table automatically

viwaltzer

Registered User.
Local time
Yesterday, 16:53
Joined
Sep 12, 2012
Messages
15
My users do not want the record saved until they've looked at the data & hit a save or cancel button. I've been researching this & found this code to stop the update (I'll work on code updates after I figure this out):

Private Sub Form_BeforeUpdate(Cancel As Integer)
Cancel = True
Me.Undo
End Sub

The problem with it is that after clicking on the tab or enter key after the last field on the form, it clears all the data from the form. I do not want this to happen. They want to look at the data. If I leave the "me.undo" off, the form freezes.

I'm a newbie to access. Help would be appreciated. Thanks :banghead:
 
It sounds like a behavior issue. When you Tab or Enter from the last field in the form, the cursor is moving to the first field in the next record, forcing the Update related events.

You want to change the behavior of Tab and Enter so that the current record stays current.

You can set the Cycle property of your form to Current Record to keep the cursor from moving to the next record.

If hitting Enter from the last field still moves to the next record, you can go to File -> Options -> Client Settings to change the behavior of the Enter key. :)
 
Last edited:
That worked to stay on the record. Thank you. But now when I do try and save a record with my Save Record button, it says "no current record". Do you know what I need to do now? Thanks much:confused:
 
Access saves data when it is told to save, or when one moves to a different record. Until that time, new or altered data can be undone with the Esc key. You have stopped the accidental changing of record. Good.

Perhaps your code in the BeforeUpdate event is now unnecessary, and may even be causing your current problem. Comment out the relevant code, and test the form.
 

Users who are viewing this thread

Back
Top Bottom