no confermation on recored deletion

J

jon

I have a button which deletes the current record on a input form but it asks
for confermation which I do not want as it is a input form.
So what code do I need etc soit does not ask for confermation?
The code is to run in access 97


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70


DoCmd.Close


Thanks in advance
Jon
 
G

Guest

Jon:

Turn the warnings off then on again like this:

Private Sub cmdDeleteClick()

On Error GoTo Err_cmdDeleteClick

DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_cmdDeleteClick:
DoCmd.SetWarnings True
Exit Sub

Err_cmdDeleteClick:
MsgBox Err.Description
Resume Exit_cmdDeleteClick

End Sub

Ken Sheridan
Stafford, England
 
J

jon

Sorted

Thank you

Jon


Ken Sheridan said:
Jon:

Turn the warnings off then on again like this:

Private Sub cmdDeleteClick()

On Error GoTo Err_cmdDeleteClick

DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_cmdDeleteClick:
DoCmd.SetWarnings True
Exit Sub

Err_cmdDeleteClick:
MsgBox Err.Description
Resume Exit_cmdDeleteClick

End Sub

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top