If no change has taken place to the form, it should ask if the person wants to quit, if yes, it should quit else if no it should remain in the form
after change has been made, it should check if person wants to save changes , if yes, it should check if all the required fields have been entered, if no it should discard changes and quit
the following is the code i have so far

On Error GoTo Err_newwoclose_Click
If Me.Dirty = False Then
If MsgBox("Do you wish to quit?", vbInformation + vbYesNo, "Confirm Save") = vbYes Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acNew, , acMenuVer70
End If
End If

If IsNull(Dept) Then
Response = MsgBox("Please enter the Department", Style1, Title1)

Else:
On Error GoTo Err_newwoclose_Click
If Me.Dirty Then
If MsgBox("Do you wish to save the record ?", vbInformation + vbYesNo, "Confirm Save") = vbNo Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If
End If
DoCmd.Close

Exit_newwoclose_Click:
Exit Sub

Err_newwoclose_Click:
MsgBox err.Description
Resume Exit_newwoclose_Click
End If
End Sub

Obviously it doesnt do the job, any help would be greatly appreciated