P
Phil
i hope someone can help me with the code below, i am new to access and very
new at vba code but see it as a nessesary evil to do what i need.
the code below was supposed to delete arecord but before doing the delete
ask if i would like to send an email of confirmation, all 0f this seems to
work. i.e. the email is sent and the record deleted. the problem is that i
then get a dialogue box come up that says Resume without Error with one
button OK. on pressing this i get a blank dialogue box with an ok button
press this and return to Resume without Error with one button OK ad infinitum
i have to ctrl-Alt-Del out of access
Private Sub Delete_Record_Click()
On Error GoTo Err_Delete_Record_Click
If vbYes = MsgBox("Do you want to send an email?", _
vbYesNo + vbQuestion, "Send Email?") Then
'Send the email
DoCmd.SendObject , "", "", "pmayor", "", "", "Cancellation of Cancer
Course", "Dear Colleague, Following recent communication I can confirm that
your place on the Cancer Course has been Cancelled. Thank you Phil", False,
""
Copy_of_sendemail_Exit:
End If
'Code to delete the record
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Delete_Record_Click:
Err_Delete_Record_Click:
MsgBox Err.Description
Resume Exit_Delete_Record_Click
End Sub
hope you can help
Phil
new at vba code but see it as a nessesary evil to do what i need.
the code below was supposed to delete arecord but before doing the delete
ask if i would like to send an email of confirmation, all 0f this seems to
work. i.e. the email is sent and the record deleted. the problem is that i
then get a dialogue box come up that says Resume without Error with one
button OK. on pressing this i get a blank dialogue box with an ok button
press this and return to Resume without Error with one button OK ad infinitum
i have to ctrl-Alt-Del out of access
Private Sub Delete_Record_Click()
On Error GoTo Err_Delete_Record_Click
If vbYes = MsgBox("Do you want to send an email?", _
vbYesNo + vbQuestion, "Send Email?") Then
'Send the email
DoCmd.SendObject , "", "", "pmayor", "", "", "Cancellation of Cancer
Course", "Dear Colleague, Following recent communication I can confirm that
your place on the Cancer Course has been Cancelled. Thank you Phil", False,
""
Copy_of_sendemail_Exit:
End If
'Code to delete the record
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Delete_Record_Click:
Err_Delete_Record_Click:
MsgBox Err.Description
Resume Exit_Delete_Record_Click
End Sub
hope you can help
Phil