G
Guest
Hi Groupies!
I need some help with making my code stop processing anything else.
I need to be able to delete information about a student while on the student
form, but I do not want any other code or tests to run after deleting the
student. At the moment, after pushing the delete button, I will receive
numerous warnings that the record was deleted by another user or the debugger
will get hung up on a different subroutine for the Current event of the
student form that I am on.
Here is the critical part of the code for my command button:
<snip>
If MsgBox(strMsg, vbYesNo + vbExclamation, "DELETE CHILD") = vbNo Then
Exit Sub
Else
docmd.SetWarnings False
docmd.Hourglass True
docmd.OpenQuery "qdelAppointments"
docmd.OpenQuery "qdelChildOT"
docmd.OpenQuery "qdelChildPT"
docmd.OpenQuery "qdelStudentDetails"
docmd.OpenQuery "qdelStudent"
docmd.Hourglass False
Me.cmbChildSearch.Requery
MsgBox "Child Successfully Deleted!", vbOKOnly, "DELETE CHILD"
docmd.SetWarnings True
End If
Exit_cmdDeleteChild_Click:
Exit Sub
Err_cmdDeleteChild_Click:
MsgBox Err.Description
Resume Exit_cmdDeleteChild_Click
<snip>
I think part of the problem may be that not all students will show up in
some of the delete queries that I ask to run. However, I do not know how to
program in a test for that.
Thanks for the brainwaves!
I need some help with making my code stop processing anything else.
I need to be able to delete information about a student while on the student
form, but I do not want any other code or tests to run after deleting the
student. At the moment, after pushing the delete button, I will receive
numerous warnings that the record was deleted by another user or the debugger
will get hung up on a different subroutine for the Current event of the
student form that I am on.
Here is the critical part of the code for my command button:
<snip>
If MsgBox(strMsg, vbYesNo + vbExclamation, "DELETE CHILD") = vbNo Then
Exit Sub
Else
docmd.SetWarnings False
docmd.Hourglass True
docmd.OpenQuery "qdelAppointments"
docmd.OpenQuery "qdelChildOT"
docmd.OpenQuery "qdelChildPT"
docmd.OpenQuery "qdelStudentDetails"
docmd.OpenQuery "qdelStudent"
docmd.Hourglass False
Me.cmbChildSearch.Requery
MsgBox "Child Successfully Deleted!", vbOKOnly, "DELETE CHILD"
docmd.SetWarnings True
End If
Exit_cmdDeleteChild_Click:
Exit Sub
Err_cmdDeleteChild_Click:
MsgBox Err.Description
Resume Exit_cmdDeleteChild_Click
<snip>
I think part of the problem may be that not all students will show up in
some of the delete queries that I ask to run. However, I do not know how to
program in a test for that.
Thanks for the brainwaves!