Hi Steve
Try this (change the messages to what you want) take off the "else" if you
don't want it.
Private Sub Button_Click()
DoCmd.SetWarnings False
If MsgBox("Do you really want to delete this record?", vbQuestion + vbYesNo)
= vbYes Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Else
MsgBox "OK it's not been cancelled"
End If
DoCmd.SetWarnings True
End Sub

Signature
Wayne
Manchester, England.
> hello
>
[quoted text clipped - 5 lines]
>
> Please help !!! as its driving me made
smason - 11 Jan 2008 15:12 GMT
Hello
thanks for the reply
how ever i am getting an error on this line
If MsgBox("Do you really want to delete this record?", vbQuestion + vbYesNo)
= vbYes Then
is is red!
any ideas
> Hi Steve
>
[quoted text clipped - 22 lines]
> >
> > Please help !!! as its driving me made
Wayne-I-M - 11 Jan 2008 16:08 GMT
It's on one line - this forum text box sometimes shortens lines - make sure
that
If MsgBox("Do you really want to delete this record?", vbQuestion + vbYesNo)
= vbYes Then
(Mind you - you may say "that" one one line as well - oh well)

Signature
Wayne
Manchester, England.
> Hello
>
[quoted text clipped - 33 lines]
> > >
> > > Please help !!! as its driving me made
smason - 11 Jan 2008 15:35 GMT
sorry it worked perfectly
i am stupid!
> Hi Steve
>
[quoted text clipped - 22 lines]
> >
> > Please help !!! as its driving me made
Try somehting like this:
private sub button_click
dim iChoice as Integer
iChoice= msgbox("Do you want to delete?", vbYesNo)
Select Case iChoice
Case=6
DoCmd.DoMenuItem acFormbar, acEditMenu, 8, ,acMenuVer70
DoCmd.DoMenuItem acFormbar, acEditMenu, 8, ,acMenuVer70
Case = 7
'-> do what you want to do in case of No...
End Select
end sub
The docmd. option is a wizard generated piece of code while creating a
deletebutton with the wizard.
hth

Signature
Maurice Ausum
> hello
>
[quoted text clipped - 5 lines]
>
> Please help !!! as its driving me made
smason - 11 Jan 2008 15:21 GMT
Hello Maurice
thanks for the reply
however when i tried this the message box came up but it didn't delete the
record!
also what could i do if the answer is no how would i just leave the record
there!
any ideas !!!
thanks in advance
> Try somehting like this:
>
[quoted text clipped - 27 lines]
> >
> > Please help !!! as its driving me made