How to Delete a record?

database

Registered User.
Local time
Today, 15:40
Joined
Jun 3, 2004
Messages
80
Hi everyone,

I need to delete a record by the command button. I used the wizrd to make the command button, but it deletes the record sometimes and sometimes it doesnt. Can anyone tell me what do i do to delete a record?

here is the code prosuced byt the wizrd:
Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click


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

Exit_cmdDelete_Click:
Exit Sub

Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click

End Sub


thanks for you help !
dB
 
personally, i'd use the button to execute a delete query. seems like it might be easier to do than using VBA
 
Roxtar said:
personally, i'd use the button to execute a delete query. seems like it might be easier to do than using VBA


You are right...But why doesnt it work always? Does that happen to you too??

Thanks for your reply
dB
 

Users who are viewing this thread

Back
Top Bottom