Any help you can give on this would be great. I've got everything ready but the "TO", and it's giving me a hell of a time...
I'm trying to get my form to send an email to the "recipient" that is listed on the form. The email is basically going to a wireless carrer, which will make an SMS message from the email. The recipient is listed in a combo box on the form that is pulling from tbl_RECIPIENTS.NAME . The "TO" address is basically supposed to be formatted TBL_CARRIERS.PREFIX & tbl_RECIPIENTS.PHONE & TBL_CARRIERS.SUFFIX & TBL_CARRIERS.DOMAIN .
I've tried using the following sql to pull the info (into "FOO" below), but I can't get it to work. :
Access 2003
relevant tables/fields/forms:
tbl_RECIPIENTS.NAME
tbl_RECIPIENTS.PHONE
tbl_RECIPIENTS.CARRIER (LOOKUP TO tbl_CARRIERS.CARRIER)
TBL_CARRIERS.CARRIER
TBL_CARRIERS.PREFIX
TBL_CARRIERS.DOMAIN
TBL_CARRIERS.SUFFIX
[Forms]![FRM_MESSAGE]![RECIPIENT]
Here's the code I'm using to generate the email (FOO replaces the "TO" address):
DoCmd.SendObject , "Send this Referral", aForm, strEmailAddress, , "name@gmail.com", subject, Body, False
End Sub
Michael Phipps
Technical Business Analyst
Mercy Health Plans
I'm trying to get my form to send an email to the "recipient" that is listed on the form. The email is basically going to a wireless carrer, which will make an SMS message from the email. The recipient is listed in a combo box on the form that is pulling from tbl_RECIPIENTS.NAME . The "TO" address is basically supposed to be formatted TBL_CARRIERS.PREFIX & tbl_RECIPIENTS.PHONE & TBL_CARRIERS.SUFFIX & TBL_CARRIERS.DOMAIN .
I've tried using the following sql to pull the info (into "FOO" below), but I can't get it to work. :
Code:
SQL:
SELECT TBL_CARRIERS.PREFIX, TBL_RECIPIENTS.PHONE, TBL_CARRIERS.SUFFIX, TBL_CARRIERS.DOMAIN FROM TBL_RECIPIENTS RIGHT JOIN (TBL_CARRIERS RIGHT JOIN TBL_MESSAGE ON TBL_CARRIERS.CARRIER = TBL_MESSAGE.CARRIER) ON TBL_RECIPIENTS.NAME = TBL_MESSAGE.RECIPIENT WHERE [Forms]![FRM_MESSAGE]![RECIPIENT]= tbl_RECIPIENTS.NAME
relevant tables/fields/forms:
tbl_RECIPIENTS.NAME
tbl_RECIPIENTS.PHONE
tbl_RECIPIENTS.CARRIER (LOOKUP TO tbl_CARRIERS.CARRIER)
TBL_CARRIERS.CARRIER
TBL_CARRIERS.PREFIX
TBL_CARRIERS.DOMAIN
TBL_CARRIERS.SUFFIX
[Forms]![FRM_MESSAGE]![RECIPIENT]
Here's the code I'm using to generate the email (FOO replaces the "TO" address):
Code:
Private Sub Command17_Click()
Dim subject As String, Body As String, strEmailAddress As String
strEmailAddress = FOO
subject = "New Referral"
Body = "FACILITY: " & [FACILITY] & Chr$(13) & "ROOM: " & [ROOM] & Chr$(13) & "PATIENT: " & [PATIENT] & Chr$(13) & [MESSAGE] & Chr$(13) & [HIDEUSER]
End Sub
Michael Phipps
Technical Business Analyst
Mercy Health Plans