If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Custom message on delete
I have a command button on a form to delete and I would
like to add a custom delete confirmation (as opposed to the "you are about to delete..." message. I need to know the syntax to do that along with where it will be placed in the code. Thanks in advance. Happy weekend all. Here is my code: Private Sub cmdDelete_Click() On Error GoTo Err_cmdDelete_Click DoCmd.RunCommand acCmdSelectRecord DoCmd.RunCommand acCmdDeleteRecord Exit_cmdDelete_Click: Exit Sub Err_cmdDelete_Click: MsgBox Err.Description Resume Exit_cmdDelete_Click End Sub |
#2
|
|||
|
|||
Custom message on delete
For you form there is an event that fires when a record is deleted. "On
Delete" in the Form Properties under events. Put a MSGBox in that even procedure... Private Sub Form_Delete(Cancel As Integer) dim myresp as integer myresp = MSGBOX("Are you sure you want to delete the current Record?", vbyesno, "Deletion Confirmation") if myresp = vbno then cancel = true endif End Sub HTH Kat "DD" wrote in message ... I have a command button on a form to delete and I would like to add a custom delete confirmation (as opposed to the "you are about to delete..." message. I need to know the syntax to do that along with where it will be placed in the code. Thanks in advance. Happy weekend all. Here is my code: Private Sub cmdDelete_Click() On Error GoTo Err_cmdDelete_Click DoCmd.RunCommand acCmdSelectRecord DoCmd.RunCommand acCmdDeleteRecord Exit_cmdDelete_Click: Exit Sub Err_cmdDelete_Click: MsgBox Err.Description Resume Exit_cmdDelete_Click End Sub |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't delete message from Outbox | Barry Brown | General Discussion | 14 | June 9th, 2004 06:10 AM |
I can't delete a message from my outbox | Joey | General Discussion | 1 | June 4th, 2004 04:31 AM |
Cannnot delete an email message in inbox | Andy | General Discussion | 2 | June 3rd, 2004 04:52 PM |
Macro Custom Buttons - How do I delete them | Sheila | Worksheet Functions | 5 | June 1st, 2004 02:40 PM |
quick delete e-mail message | Roy | Outlook Express | 1 | May 30th, 2004 02:16 PM |