This is a second try to get a solution for this challenge. I've got my coded listed below. What I've got is a continuous form that has an email address in the first field. I've set it up so that when I double-click on the field it will open an email while inserting certain info in the message. Now the first time i run this procedure it works great. BUT when I try to run the procedure on another record nothing happens. I have to close the db and reopen it to make it work on another record.
Any thoughts as to why?
Public Function Email()
On Error GoTo Err_Email
Dim strTo As String, strMsg As String, strSubject As String
strTo = Me!txtRequestor.Value & "@hotmail.com"
strSubject = "Completed Request"
strMsg = Me!txtPayee & " in " & Me!txtCounty & " county, " & Me!txtState & " is completed."
DoCmd.SendObject acSendNoObject, , , strTo, , , strSubject, strMsg, True
Exit Function
Err_Email:
If Err.Number = 2501 Then
Exit Function
Else
MsgBox Err.Number & " " & Err.Description
Exit Function
End If
End Function
Any thoughts as to why?
Public Function Email()
On Error GoTo Err_Email
Dim strTo As String, strMsg As String, strSubject As String
strTo = Me!txtRequestor.Value & "@hotmail.com"
strSubject = "Completed Request"
strMsg = Me!txtPayee & " in " & Me!txtCounty & " county, " & Me!txtState & " is completed."
DoCmd.SendObject acSendNoObject, , , strTo, , , strSubject, strMsg, True
Exit Function
Err_Email:
If Err.Number = 2501 Then
Exit Function
Else
MsgBox Err.Number & " " & Err.Description
Exit Function
End If
End Function