Add Record Name To Deletion MsgBox (1 Viewer)

eirman

Registered User.
Local time
Today, 09:55
Joined
Aug 16, 2013
Messages
38
I'm using this stardard piece of code on a button that deletes a record from a simple continuous contact form.
Code:
  If MsgBox("Do You Want To Delete This Record?", vbQuestion + vbYesNo + vbDefaultButton2, "Delete?") = vbYes Then
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdDeleteRecord
  End If
If the form is called "CONTACTS" with a field called "Contact_Name", what code do I use to have the relevant Contact_Name appear in the MsgBox to be sure that I'm deleting the correct record ...... something like this .....

Do You Want To Delete The Record Called Paul Quinn ?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 09:55
Joined
Feb 19, 2013
Messages
13,019
try MsgBox("Do You Want To Delete The Record for " & me.Contact_Name & "?", vbQuestion ....
 

eirman

Registered User.
Local time
Today, 09:55
Joined
Aug 16, 2013
Messages
38
That works very nicely CJ.
Many thanks.
 

Users who are viewing this thread

Top Bottom