G
Guest
I have a bunch of checkboxes to include certain things in a calculation by
default. Others can be added by clicking other checkboxes. What I want is
for the checkboxes (and everything else) to return to their original state
when the form is closed. I used this:
Private Sub Command559_Click()
On Error GoTo Err_Command559_Click
If Me.Dirty = True Then
Me.Undo
End If
DoCmd.Close
Exit_Command559_Click:
Exit Sub
Err_Command559_Click:
MsgBox Err.Description
Resume Exit_Command559_Click
End Sub
For and Exit Button and it works great...but if the user clicks the upper
right X to close the form, instead of the button, the "On Dirty" is ignored
and the changes are saved.
I tried this, but it doesn't work:
Private Sub Form_Close()
If Me.Dirty = True Then
Me.Undo
End If
End Sub
What am I doing wrong?
default. Others can be added by clicking other checkboxes. What I want is
for the checkboxes (and everything else) to return to their original state
when the form is closed. I used this:
Private Sub Command559_Click()
On Error GoTo Err_Command559_Click
If Me.Dirty = True Then
Me.Undo
End If
DoCmd.Close
Exit_Command559_Click:
Exit Sub
Err_Command559_Click:
MsgBox Err.Description
Resume Exit_Command559_Click
End Sub
For and Exit Button and it works great...but if the user clicks the upper
right X to close the form, instead of the button, the "On Dirty" is ignored
and the changes are saved.
I tried this, but it doesn't work:
Private Sub Form_Close()
If Me.Dirty = True Then
Me.Undo
End If
End Sub
What am I doing wrong?