How To Delete Genieo?

Access - how to procedurally suppress the delete confirmation dialog

  • Simple problem: I’d like to procedurally (not globally) suppress the confirmation dialog for a particular delete query. Intercepting the "before delete confirm" event doesn't seem to work. See below more more info. I have a form button that displays a list of records. The button Click event FIRST runs a DELETE query which purges the table of old records, then opens a form to display the remaining good records. Every time it does this, Access displays a warning confirmation dialog “You are about to run a delete query that will modify data in your table. Are you sure?” I want to suppress this dialog box, just for this particular operation. I DONT want to globally disable Access’ delete confirmation, so I don’t want to use the Access menu setting (clear the Record Changes check box under Confirm on the Edit/Find tab of the Options dialog box, under Options on the Tools menu). I also want the behavior to be part of the database, & behave this way when distributed to other users. I wanted to intercept the BeforeDelConfirm event as part of the click event code, but it appears to be only useful within a form's events. So, I removed the DELETE query from the button click event code and moved it to the FORM_LOAD event of the form that the button launches. I then added a Form_BeforeDelConfirm event to the form, and it uses the Response = acDataErrContinue option. However, when I click the button, the delete query confirmation still appears, and the Form_BeforeDelConfirm event never seems to fire. For what it’s worth, here’s the complete form code: -------------------- Option Compare Database Private Sub Form_Load() DoCmd.OpenQuery ("qryDeleteOld") End Sub Private Sub Form_BeforeDelConfirm(Cancel As Integer, _ Response As Integer) ' Suppress default Delete Confirm dialog box. Response = acDataErrContinue ' Display custom dialog box. If MsgBox("Hooray, this works! Delete this record?", vbOKCancel) = vbCancel Then Cancel = True End If End Sub ---------------------

  • Answer:

    This is an FAQ question. The answer can be found at: http://www.mvps.org/access/queries/qry0012.htm The home page for this FAQ is: http://www.mvps.org/access/ This is a very good Access FAQ. I recommend you bookmark it. It's full of good information. Good luck with your Access project! - Hammer

vaughn-ga at Google Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.