Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Dialog Box before run a Delete QUERY

Status
Not open for further replies.

sagamw

Technical User
Nov 11, 2009
104
GR
Hi Guys.

I have already made some custom dialog boxes when you delete records with
Code:
Private Sub Form_BeforeDelConfirm(Cancel As Integer, _
    Response As Integer)
...

However I can't find how can you display custom dialog boxes and to avoid the access's dialogs when you run a delete query.

Is there an event like BeforeDelConfirm?

I have this form with a button that runs the delete query.

How can I do it?

TIA


 
Have a look at the DoCmd.SetWarnings method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV.

As I am seeing now I came in a similar situation before (2-3 months ago) and I used the DoCmd.SetWarnings method back then.

So thank you for remind me that!

I have another little issue if you can help me however.
Not with the custom dialog box for a delete query, but for a "regular" delete of a record.

All working fine in a BeforeDelConfirm event, but I can't seem to get the name of the record (the value of a field anyway) to be included in the message box.

i.e. "Are you sure you want to delete John Smith's record?"

I tried "Are you sure you want to delete" & [surname].value &"record".

and Me![surname].value
and [forms]![nameoftheform].[surname].value

with no luck. (All Ok with the message box, except the surname is missing)

What is the proper way to refer to a field of the current (to be deleted) record, so I can include it in my msgbox?

TIA




 
I'd try to use the Delete event procedure.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top