Inserting data from a table or qry into the body of an email

action

Registered User.
Local time
Today, 19:00
Joined
May 29, 2003
Messages
89
I have spent 2 hours reading the posts with no solution to this. I am sending SMS messages via email to an SMS server and need to insert data into the body of an email as text. The data is in a temp table but could come direct from the query.

Note it must be text in the body otherwise it will not be seen by the person recieving the sms message

I have a recordset automating the email send. My current working code is:

Private Sub CMDTextResults_Click()
'On Error GoTo Err_CMDTextResults_Click

Dim db As DAO.Database
Dim rs As DAO.Recordset

Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("QRYTextPremierResultsReceipantList")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("TexTaddress").Value
DoCmd.SendObject , , , strEmail, , , "Results Central Soccer", "data from temp table to go here"
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
Set db = Nothing

'Err_CMDTextResults_Click:
' MsgBox Err.Description
' Resume Exit_CMDTextResults_Click

End Sub



How can I get the table data into the Body??

Thanks all replies
 

Users who are viewing this thread

Back
Top Bottom