If you close the form down and it checks to see if work needs to be saved it's usually common practice to have a Cancel option to. The code will look like:
Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode
As Integer)
Response = MsgBox("Save Changes?",vbYesNoCancel + vbQuestion,"Save")
Select Case Response
Case vbYes
If Not Save_Changes Then
Cancel = True
End If
Case vbNo
'No Code Here!!!
Case vbCancel
Cancel = True
End Select
If Cancel Then
cmdSave.SetFocus
End If
End Sub
Private Function Save_Changes() as Boolean
'Code for saving data
End Function
If you click NO then the form just unloads and doesn't Save. If you Click cancel then the form stays and it doesn't save.
If you click Yes and the Save function Returns a value of False then it hasn't save correctly and the form stays open so you can sort the changes out...