G
Guest
I'm trying to find out how to delete records from a sub form using a check
box feature.
It's a rather large database so as the user goes through editing there will
be records he will want to select for deletion. It may be one record or it
could be 10 (ormore). I have a check box field for this purpose.
If there's a check mark in the box on that record then it's to be deleted in
other words.
Then he'll click a command button and delete the records selected.
The code for the command button (named cmdremove) is as follows:
If thesub.Form!txttrash = -1 Then
On Error GoTo Err_cmdremove_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_cmdremove_Click:
Exit Sub
Err_cmdremove_Click:
MsgBox Err.Description
Resume Exit_cmdremove_Click
End If
Requery
End Sub
===========================================
Notes: "thesub" is the name of the sub form
"txttrash" is the name of the check box on the sub form
Absolutely nothing happens when I click my command button. No error message
and it doesn't delete the record either.
Can anyone provide guidance?
box feature.
It's a rather large database so as the user goes through editing there will
be records he will want to select for deletion. It may be one record or it
could be 10 (ormore). I have a check box field for this purpose.
If there's a check mark in the box on that record then it's to be deleted in
other words.
Then he'll click a command button and delete the records selected.
The code for the command button (named cmdremove) is as follows:
If thesub.Form!txttrash = -1 Then
On Error GoTo Err_cmdremove_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_cmdremove_Click:
Exit Sub
Err_cmdremove_Click:
MsgBox Err.Description
Resume Exit_cmdremove_Click
End If
Requery
End Sub
===========================================
Notes: "thesub" is the name of the sub form
"txttrash" is the name of the check box on the sub form
Absolutely nothing happens when I click my command button. No error message
and it doesn't delete the record either.
Can anyone provide guidance?