Confirmation message box before adding new record

AgDawg

Registered User.
Local time
Today, 16:58
Joined
Oct 12, 2012
Messages
24
I want to have a box pull up that asks the user if they are sure you want to add new record. If no then the update is canceled. Here is my code on the before update currently:

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Len(Me.GenericCode & vbNullString) = 0 Then
  MsgBox "Enter a Product Code"
  Cancel = True
    Me.GenericCode.SetFocus
End If

End Sub
 
If msgbox("Are you sure you want to change this record?", vbYesNo+vbdefaultbutton1+vbQuestion,"Change Record?") = vbNo then
Cancel=True
end if
 
Works perfect Thanks!
 

Users who are viewing this thread

Back
Top Bottom