No Show Delete Confirm popup

  • Thread starter Thread starter Jim D
  • Start date Start date
J

Jim D

When deleting records from a form I want to create my own
delete confirm popup up because linked records will be
deleted and the default delete confirm isn't clear. I've
put a popup in the OnDelete event but the default popup
still comes up. Is there any way to disable the default
popup.

Thanks
Jim
 
Thanks Bill,
I thought about that but then I would have to set that
option at start up because there's multipul users. I was
hoping there was a programatic way to do it.

Thanks again
Jim
 
Jim

Try adding

DoCmd.SetWarnings False

and

DoCmd.SetWarnings True

around your delete code

HTH

Andy
 
To suppress the dialog question for just this one form, use the
BeforeDelConfirm event of the form:
Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
Response = acDataErrContinue
End Sub

Using the OnDelete event to display your own message box is fine. The
functional difference is that if the user selects multiple records at a time
(e.g. in Continuous or Datasheet view), they will receive one MsgBox for
each record, whereas the default behaviour in the BeforeDelConfirm event is
one MsgBox for all.
 
Hi, I'm working on an Excel/VBA assignment where I need to delete a temporary worksheet that I created when I click on Cancel and I just want to disable the delete confirmation box that pops up everytime the Cancel button is clicked.

This is my code at the moment:

Private Sub cmdCancel_Click()
Unload Me

DoCmd.SetWarnings False
Application.Sheets("New Order").Select
ActiveWindow.SelectedSheets.Delete
DoCmd.SetWarnings True

End Sub

It seems to work except that it comes up as a run-time error: "Object variable or With block variable not set".

Any help would be much appreciated! TIA :)
 
Last edited:
Back
Top