Hello All,
I have a close button on my form that if the user has made changes, a message box pops up asking if they want to save the changes. That works fine. See below...
Private Sub cmd_Close_Click()
If (Me.Dirty = True) Then
If MsgBox("Do you want to save your changes?", vbYesNo + vbInformation, "Close") = vbYes Then
DoCmd.Close acForm, Me.Name
Else
Me.Undo
DoCmd.Close acForm, Me.Name
End If
End If
End Sub
What I can't figure out is how to bypass all of the code and just close the form if the user has not made any changes to the record. None of the records in this table are new.
Am I going about this the wrong way? Maybe there is a simpler solution. All ideas or suggestions welcome.
Thanks,
Trish
I have a close button on my form that if the user has made changes, a message box pops up asking if they want to save the changes. That works fine. See below...
Private Sub cmd_Close_Click()
If (Me.Dirty = True) Then
If MsgBox("Do you want to save your changes?", vbYesNo + vbInformation, "Close") = vbYes Then
DoCmd.Close acForm, Me.Name
Else
Me.Undo
DoCmd.Close acForm, Me.Name
End If
End If
End Sub
What I can't figure out is how to bypass all of the code and just close the form if the user has not made any changes to the record. None of the records in this table are new.
Am I going about this the wrong way? Maybe there is a simpler solution. All ideas or suggestions welcome.
Thanks,
Trish