Changing the default delete form message

  • Thread starter Thread starter Ammo
  • Start date Start date
A

Ammo

Does anyone know how to change the wording on Access's
default message that appears when you click the 'delete
record' form button?

Regards

Ammo
 
Does anyone know how to change the wording on Access's
default message that appears when you click the 'delete
record' form button?

Regards

Ammo

You can't change it's wording but you can show your own warning form.

Create a new unbound form.
Place your message in a label.
Add a text control.
Name the control "txtResponse"
You can make the text control not visible if you wish.
Add 2 Command buttons:
CommandOK
CommandNo


Code the CommandOK click event:
[txtResponse] = "OK"
Me.Visible = False

Code the CommandNo click event:
[txtResponse] = "No"
Me.Visible = False

Name the form "frmDeletionMessage"
======
Code your existing Form's BeforeDelConfirm event:

DoCmd.SetWarnings False
DoCmd.OpenForm "frmDeletionMessage", , , , , acDialog
If Forms!ffrmDeletionMessage!txtResponse = "No" Then
Cancel = True
End If
DoCmd.Close acForm, "frmDeletionMessage"
DoCmd.SetWarnings True

The default message will not appear.
Your message will.
If the user clicks the OK button, the record will be deleted.
If the user clicks the No button, the record will not be deleted.
 
Hi Fred

Thank you for your help, but does anyone know how to
remove the DoMenuItem message that appears on screen when
you select not to delete a record?

Regards

Ammo
-----Original Message-----
Does anyone know how to change the wording on Access's
default message that appears when you click the 'delete
record' form button?

Regards

Ammo

You can't change it's wording but you can show your own warning form.

Create a new unbound form.
Place your message in a label.
Add a text control.
Name the control "txtResponse"
You can make the text control not visible if you wish.
Add 2 Command buttons:
CommandOK
CommandNo


Code the CommandOK click event:
[txtResponse] = "OK"
Me.Visible = False

Code the CommandNo click event:
[txtResponse] = "No"
Me.Visible = False

Name the form "frmDeletionMessage"
======
Code your existing Form's BeforeDelConfirm event:

DoCmd.SetWarnings False
DoCmd.OpenForm "frmDeletionMessage", , , , , acDialog
If Forms!ffrmDeletionMessage!txtResponse = "No" Then
Cancel = True
End If
DoCmd.Close acForm, "frmDeletionMessage"
DoCmd.SetWarnings True

The default message will not appear.
Your message will.
If the user clicks the OK button, the record will be deleted.
If the user clicks the No button, the record will not be deleted.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Back
Top