To anyone who can help,
I have a mainform that contains employee information and in that form I have a continuous subform with employee points information.
I've added a delete button in the subform, that shows up on each row since it is continuous.
I've used a generic delete button that was created through the Access Wizard. When I click on the delete button, it always deletes the first record in the subform, never the record where the delete button is located.
This is the code obtained from the wizard. I'm assuming I need a different code but am not experienced enough to come up with it myself. Please help:
Private Sub btn_delete_Click()
On Error GoTo Err_btn_delete_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_btn_delete_Click:
Exit Sub
Err_btn_delete_Click:
MsgBox Err.Description
Resume Exit_btn_delete_Click
End Sub
I have a mainform that contains employee information and in that form I have a continuous subform with employee points information.
I've added a delete button in the subform, that shows up on each row since it is continuous.
I've used a generic delete button that was created through the Access Wizard. When I click on the delete button, it always deletes the first record in the subform, never the record where the delete button is located.
This is the code obtained from the wizard. I'm assuming I need a different code but am not experienced enough to come up with it myself. Please help:
Private Sub btn_delete_Click()
On Error GoTo Err_btn_delete_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_btn_delete_Click:
Exit Sub
Err_btn_delete_Click:
MsgBox Err.Description
Resume Exit_btn_delete_Click
End Sub