R
rebecky via AccessMonster.com
Hello. I have a delete button that uses code I found here, but I want a
msgbox to say there is nothing to delete if the user is going through the
form pushing icons and the record is blank (for training purposes). It
seems so simple but I cannot figure it out.
Here is the button code,,,,,how would I have a msgbox pop up if they hit the
delete button and there is nothing to delete?
DoCmd.SetWarnings False
If MsgBox("You are About to Delete this Position. Do you really really
really want to DO this?", vbOKCancel, "TED version 2.1") = vbCancel Then
Cancel = True
MsgBox "TED has Canceled Deleting this Position ", vbOKOnly, "TED version 2.
1"
Exit Sub
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
MsgBox "The Position has been Deleted", vbOKOnly, "TED version 2.1"
End If
Exit_Command212_Click:
Exit Sub
Err_Command212_Click:
Resume Exit_Command212_Click
Thank you in advance for any ideas!!
rebecky
msgbox to say there is nothing to delete if the user is going through the
form pushing icons and the record is blank (for training purposes). It
seems so simple but I cannot figure it out.
Here is the button code,,,,,how would I have a msgbox pop up if they hit the
delete button and there is nothing to delete?
DoCmd.SetWarnings False
If MsgBox("You are About to Delete this Position. Do you really really
really want to DO this?", vbOKCancel, "TED version 2.1") = vbCancel Then
Cancel = True
MsgBox "TED has Canceled Deleting this Position ", vbOKOnly, "TED version 2.
1"
Exit Sub
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
MsgBox "The Position has been Deleted", vbOKOnly, "TED version 2.1"
End If
Exit_Command212_Click:
Exit Sub
Err_Command212_Click:
Resume Exit_Command212_Click
Thank you in advance for any ideas!!
rebecky