View Single Post
  #2  
Old September 18th, 2009, 02:06 PM posted to microsoft.public.access.tablesdbdesign
Rich Stone
external usenet poster
 
Posts: 52
Default Dialog box prevents record deleting

Can anyone help please? This is really holding me up with my project now

"Rich Stone" wrote:

I have a database with standard record function buttons. However, my 'Delete'
button seems to have a problem. When I add vb code to bring up a custom
dialog asking the user whether they definitely wish to delete the current
record, nothing happens after it. However, when I remove the dialog box code,
the record deletes immediately the button is pressed.

My code is as follows:

x = MsgBox("Are you sure you wish to delete the current record?",
vbYesNo + vbExclamation)
If x = vbNo Then
Exit Sub
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
End If

Any ideas