can't delete

Neo

Registered User.
Local time
Today, 23:24
Joined
Mar 5, 2003
Messages
42
I am using this code to delete a record

Private Sub CmdRemove_Click()

If MsgBox("Are you sure you want to delete Part Number " & Me.PartNo & " from the order", vbYesNo) = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord

DoCmd.SetWarnings True
Me.Requery
Else
End If
End Sub

each time I get the eror 2046 the action delete record is not available now

This use to work.

Any ideas

thanks
 
If MsgBox("Are you sure you want to delete Part Number " & Me.PartNumber & " from the order", vbYesNo) = vbYes Then

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings True
Me.Requery
Else
Exit Sub
End If
 
mark curtis said:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

That's pretty much obsolete now. Keep this line:

Code:
DoCmd.RunCommand acCmdDeleteRecord


The problem sounds like one of your references is missing. There have been numerous posts on references so just do a search on them and that might get you sorted out.
 

Users who are viewing this thread

Back
Top Bottom