Sending Email with POC

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use the DoCmd.SendObject acSendNoObject that sends out an email. It gets
the data from the record that it is in. I would like to add some data that is
in the following table.

Table: COL_1St_PM
C1_PM_Name
C1_PM_Phone

If I could have the DoCmd.SendObject acSendNoObject put this at the end of
the E-amil the Point of Contact would be on all emails.

Thanks

Private Sub Command1364_Click()
DoCmd.SendObject acSendNoObject, , , "(e-mail address removed)", , ,
"College First Reenrollment for " & [indiv_name] & " SSN:" & [ind_ssn], "" _
& "Reenrollment for " & [indiv_name] & ", SSN:" & [ind_ssn] & vbCrLf &
vbCrLf & "DEP In Date: " & [DEPInDate] & "New Enrollment Dates: START DATE: "
& [Sem Start Date] & " End Date: " & [Sem End Date] & vbCrLf & vbCrLf &
"Enrollment History:" & vbCrLf & [REMARKS], , True
End Sub
 
KAnoe,

Do you mean there is only one record in this COL_1St_PM table? If so,
one approach would be to simply add this table to the query that the
form is based on, include these fields on the form, and then include the
data in the email in the same way you have included other data from the
form record in the email body.

Another approach would be to use DLookup() functions to get the values
for inclusion in your email. For example...
Dim POC_Name As String
Dim POC_Phone As String
POC_Name = DLookup("[C1_PM_Name]","COL_1St_PM")
POC_Phone = DLookup("[C1_PM_Phone]","COL_1St_PM")
.... and then use these POC_Name and POC_Phone variables in the
construction of your email message.
 
Yes only on record in the table.

Thanks Steve.


Steve Schapel said:
KAnoe,

Do you mean there is only one record in this COL_1St_PM table? If so,
one approach would be to simply add this table to the query that the
form is based on, include these fields on the form, and then include the
data in the email in the same way you have included other data from the
form record in the email body.

Another approach would be to use DLookup() functions to get the values
for inclusion in your email. For example...
Dim POC_Name As String
Dim POC_Phone As String
POC_Name = DLookup("[C1_PM_Name]","COL_1St_PM")
POC_Phone = DLookup("[C1_PM_Phone]","COL_1St_PM")
.... and then use these POC_Name and POC_Phone variables in the
construction of your email message.

--
Steve Schapel, Microsoft Access MVP

I use the DoCmd.SendObject acSendNoObject that sends out an email. It gets
the data from the record that it is in. I would like to add some data that is
in the following table.

Table: COL_1St_PM
C1_PM_Name
C1_PM_Phone

If I could have the DoCmd.SendObject acSendNoObject put this at the end of
the E-amil the Point of Contact would be on all emails.

Thanks

Private Sub Command1364_Click()
DoCmd.SendObject acSendNoObject, , , "(e-mail address removed)", , ,
"College First Reenrollment for " & [indiv_name] & " SSN:" & [ind_ssn], "" _
& "Reenrollment for " & [indiv_name] & ", SSN:" & [ind_ssn] & vbCrLf &
vbCrLf & "DEP In Date: " & [DEPInDate] & "New Enrollment Dates: START DATE: "
& [Sem Start Date] & " End Date: " & [Sem End Date] & vbCrLf & vbCrLf &
"Enrollment History:" & vbCrLf & [REMARKS], , True
End Sub
 
Back
Top