I have a subform inside a form. By default, when I change a record in the subform, the record will automatically save when I click outside the subform. I added a button on the main form that manually saves records in the form and subform, so I cancelled saving on subform exit to avoid write conflicts.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.Undo
Cancel = True
End Sub
With this code, clicking outside the subform will not only cancel saving, but will also clear anything I enter in the subform. This means I can't save the form without first cancelling the subform changes.
How do I cancel automatic saving in a subform while keeping any edits until they exit the main form?