How to make form to delete record from table in Access 2002
Moderator: General Moderators
How to make form to delete record from table in Access 2002
I like to give First Name and Last Name in two different text box and then hit the delete button (command button). Then it will do a query to find the person and delete the corresponding record from the table. Any kind of help will be appreciated. Thank you.
I ma pretty sure that event procedure need to be used for this problem. But nor sure where to change the following code to make things happen.
Option Compare Database
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
Option Compare Database
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub