I used the (msaccess 97 ) wizard to create a delete button placed on a form.
The button works fine; however, When I click the button and select no to deleting the record, I get what appears to be a standard MS msgbox that says "The DoMenuItem was canceled.." and some other stuff that would probably confuse a user. It also sends you to the last record and since I am using the continuous forms view, if, for example, you have 3 records showing before you hit delete, now it looks like you only have 1! Of course, you can just hit the navigation button to bring them back, but this appears to me an unecessary potential confusion for the user (note, to get around this, I add some code under the "Exit_Command6_Click:
" code to go to the first record which solves this issue)..
My question is, how do I get rid of the MS Access generated message and insert my own more user friendly message if the user selects to cancel the delete request. Also, is there anywhere that shows what the instrinsic constant values refer to? 8 and 6 don't help much..
Thanks for any help..here is the code that the wizard generated..(with the exception of: DoCmd.GoToRecord acDataForm, "frm_view_assoc_rec", acFirst.
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Command6_Click:
DoCmd.GoToRecord acDataForm, "frm_view_assoc_rec", acFirst
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click
End Sub
The button works fine; however, When I click the button and select no to deleting the record, I get what appears to be a standard MS msgbox that says "The DoMenuItem was canceled.." and some other stuff that would probably confuse a user. It also sends you to the last record and since I am using the continuous forms view, if, for example, you have 3 records showing before you hit delete, now it looks like you only have 1! Of course, you can just hit the navigation button to bring them back, but this appears to me an unecessary potential confusion for the user (note, to get around this, I add some code under the "Exit_Command6_Click:
" code to go to the first record which solves this issue)..
My question is, how do I get rid of the MS Access generated message and insert my own more user friendly message if the user selects to cancel the delete request. Also, is there anywhere that shows what the instrinsic constant values refer to? 8 and 6 don't help much..
Thanks for any help..here is the code that the wizard generated..(with the exception of: DoCmd.GoToRecord acDataForm, "frm_view_assoc_rec", acFirst.
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Command6_Click:
DoCmd.GoToRecord acDataForm, "frm_view_assoc_rec", acFirst
Exit Sub
Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click
End Sub