
Signature
Thanks in advance for your help.
Jim
>If the user presses the save button on the ribbon before leaving the forms
>no error occurs.
>
>I tried to automate the pressing the save button by using SendyKeys
>"+({ENTER})", Wait to send a Shift+Enter in the On Deactivate event but it
>doesn't fix the problem.
Instead of a (VERY buggy and unreliable) Sendkeys, use either
DoCmd.RunCommand acCmdSaveRecord
or
If Me.Dirty Then Me.Dirty = False
in your code to force a record save.
Put this code in the click event of the button, before the OpenForm event, not
in the Deactivate event.
John W. Vinson [MVP]
JimW - 04 Oct 2007 23:25 GMT
Thanks John!!
The DoCmd.RunCommand acCmdSaveRecord syntax did the job!
Jim
> >If the user presses the save button on the ribbon before leaving the forms
> >no error occurs.
[quoted text clipped - 17 lines]
>
> John W. Vinson [MVP]