Can someone help me add an exception argument to my cancel as integer sub?

xwnoob

Registered User.
Local time
Today, 14:12
Joined
Nov 7, 2011
Messages
70
So i have this code:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
'Ensure that users do not accidentally save records
If MsgBox("Do you want to save the updated records?", vbOKCancel, "Save?") = vbCancel Then
Me.Undo
End If
End If
End Sub

How do i add a code inside that creates an exception for a button that goes to a new record? I want to add the exception for my add new record button but i dont know which function/command to use
progress.gif
 
put this first

if me.newrecord then exit sub

then it will only ask the question for existing records.
 

Users who are viewing this thread

Back
Top Bottom