G
Guest
I am trying to create code to delete the current record in my form when the
user closes the form if a particular field is null. If the field is null, it
would indicate that the user didn't complete enough information for the
record to be "real." Following is the code in the On Close event:
Private Sub Form_Close()
DoCmd.GoToControl "CUSTOMER_NUMBER"
If IsNull([CUSTOMER_NUMBER]) Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
End If
End Sub
Can anyone tell me why this code doesn't delete the record? Do I need to
use a different event?
Thanks in advance!
Keith
user closes the form if a particular field is null. If the field is null, it
would indicate that the user didn't complete enough information for the
record to be "real." Following is the code in the On Close event:
Private Sub Form_Close()
DoCmd.GoToControl "CUSTOMER_NUMBER"
If IsNull([CUSTOMER_NUMBER]) Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
End If
End Sub
Can anyone tell me why this code doesn't delete the record? Do I need to
use a different event?
Thanks in advance!
Keith