[AccessD] Dirty property
Susan Harkins
ssharkins at gmail.com
Thu Jul 23 08:05:33 CDT 2015
Thanks Bill. I'm glad to take a look at it.
Susan H.
On Thu, Jul 23, 2015 at 8:32 AM, Bill Benson <bensonforums at gmail.com> wrote:
> This advice I just found on the web might put this whole thing to bed and
> give a real solution - without getting rid of the close button.
>
> Option Compare Database
> Option Explicit
> Dim mbSaving As Boolean
> Private Sub Form_BeforeUpdate(Cancel As Integer)
> Dim Ctrl As Control
> If Not mbSaving Then
> Cancel = True
> End If
>
> End Sub
>
>
> Private Sub CmdSave_Click()
> mbSaving = True
> DoCmd.RunCommand acCmdSaveRecord
> mbSaving = False
> End Sub
> Private Sub Form_Error(DataErr As Integer, Response As Integer)
> If DataErr = 2169 Then
> Response = acDataErrContinue
> End If
> End Sub
>
> An even more robust version here:
>
>
> http://stackoverflow.com/questions/22360220/access-vba-run-time-error-2169-you-cant-save-this-record-at-this-time
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
More information about the AccessD
mailing list