Murray Brown
asked on
Access VBA Compile Error Sub or Function not defined
Hi
In my Access VBA code below, the Sub Form_BeforeUpdate code causes an error "Compile Error Sub or Function not defined"
In my Access VBA code below, the Sub Form_BeforeUpdate code causes an error "Compile Error Sub or Function not defined"
Private blnSaved As Boolean
Private Sub Form_BeforeUpdate(Cancel As Integer)
If blnSaved = False Then
Cancel = True
Me.Undo
Cancel = False
End If
End Sub
Private Sub Form_Current()
blnSaved = False
End Sub
Private Sub btnOK_Click()
blnSaved = True
MsgBox "Changes saved!"
End Sub
Private Sub btnCancel_Click()
DoCmd.Close
End Sub
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks
https://www.experts-exchange.com/questions/29080811/Access-VBA-Code-to-stop-data-saving-to-tables.html