I am using the following code to stop data entered in an Access form being saved to a table
unless the user clicks a 'OK" button. I now want to use this in a form that has a sub form embedded
in it. There are two joined tables "Invoices" and "Invoice Detail". I created the form using the Access wizard
so can't even see it in the list of tables and forms on the left. How do I go about this?
Private blnSaved As Boolean
Private Sub btnCancel_Click()
MsgBox "Changes discarded!"
Private Sub btnOK_Click()
blnSaved = True
MsgBox "Changes saved!"
Private Sub Form_BeforeUpdate(Cancel As Integer)
If blnSaved = False Then
Cancel = True
Private Sub Form_Current()
blnSaved = False