Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete command problems

Status
Not open for further replies.

Thenolos

Technical User
Jul 15, 2004
38
I have a simple form where I use a combo box to select a record, and then a delete button to delete the record. For some reason, after I add the combo box selection code, the delete button either no longer works, or wants to delete an entire unrelated table... I'm completely clueless... Here's my code:

Private Sub Delete_User_Click()
On Error GoTo Err_Delete_User_Click

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

Exit_Delete_User_Click:
Exit Sub

Err_Delete_User_Click:
If Err.Number = 2501 Then
Resume Next
Else
Msgbox "error " & Err.Number & " " & Err.Description
End If

Resume Exit_Delete_User_Click

End Sub
Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
Response = acDataErrContinue
If Msgbox("Are you sure you want to delete this User?", vbYesNo + vbCritical, "Deleting Record...") <> vbYes Then
Cancel = True
End If
End Sub


Any ideas what might be going on? I took out the combo box selection code and the delete button still does not work... Help would be appreciated.
 
Me.RecordsetClone.Findfirst "[Id] = '" & Me![ComboboxName] & "'"
Me.Bookmark = Me.RecordSetClone.Bookmark

This is the code I used to make the combobox select the record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top