BarryMK
4 strings are enough
- Local time
- Today, 12:26
- Joined
- Oct 15, 2002
- Messages
- 1,352
I've been using code similar to that below to send an alert from a pc triggering the event from my database. I used to get the pop up warning giving the user the choice to cancel the email in case it was a hoax but now get an error message stating. "Microsoft Access can't send a message for the reason stated in the preceding alert"
There is no preceding alert and the email no longer sends. has anyone managed to solve this problem?
What the hell is MS doing?
Private Sub cmdFindPrint_Click()
On Error GoTo Err_cmdFindPrint_Click
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "rptFinder", acPreview, "", "[StrayRef]=[Forms]![frmOwnerDetsFinder]![txtStrayRef]"
Dim strEmail As String
Dim strBody As String, strSubject As String
strEmail = "me@here.co.uk"
strSubject = "Owner collecting from finder"
strBody = "Finder's details have been given to a claiming owner. Seizure Sheet Number " & Me!txtStrayRef & " " & Me!txtColour & " " & Me!txtBreedType & " "
DoCmd.SendObject , , , strEmail, , , strSubject, strBody, True
Exit_cmdFindPrint_Click:
Exit Sub
Err_cmdFindPrint_Click:
MsgBox Err.Description
Resume Exit_cmdFindPrint_Click
End Sub
There is no preceding alert and the email no longer sends. has anyone managed to solve this problem?
What the hell is MS doing?
Private Sub cmdFindPrint_Click()
On Error GoTo Err_cmdFindPrint_Click
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "rptFinder", acPreview, "", "[StrayRef]=[Forms]![frmOwnerDetsFinder]![txtStrayRef]"
Dim strEmail As String
Dim strBody As String, strSubject As String
strEmail = "me@here.co.uk"
strSubject = "Owner collecting from finder"
strBody = "Finder's details have been given to a claiming owner. Seizure Sheet Number " & Me!txtStrayRef & " " & Me!txtColour & " " & Me!txtBreedType & " "
DoCmd.SendObject , , , strEmail, , , strSubject, strBody, True
Exit_cmdFindPrint_Click:
Exit Sub
Err_cmdFindPrint_Click:
MsgBox Err.Description
Resume Exit_cmdFindPrint_Click
End Sub
Last edited: