joepineapples
08-03-2007, 08:04 AM
Hi All
I've robbed this code form this forum - thanks v much. And I can get it to work if I put "" marks around stSubject on the DoCmd line. But I don't want people to see "stSubject" but rather the content of stSubject.
How can I do this?
Sub test()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Dim stSubject As String
Set rsEmail = CurrentDb.OpenRecordset("EMailTable")
If rsEmail.Fields("Today").Value = Date Then
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("EMailAddress").Value
stSubject = rsEmail.Fields("Intervention").Value
DoCmd.SendObject , , , strEmail, , , stSubject, "This is today's message", False
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
End If
End Sub
I've robbed this code form this forum - thanks v much. And I can get it to work if I put "" marks around stSubject on the DoCmd line. But I don't want people to see "stSubject" but rather the content of stSubject.
How can I do this?
Sub test()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Dim stSubject As String
Set rsEmail = CurrentDb.OpenRecordset("EMailTable")
If rsEmail.Fields("Today").Value = Date Then
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("EMailAddress").Value
stSubject = rsEmail.Fields("Intervention").Value
DoCmd.SendObject , , , strEmail, , , stSubject, "This is today's message", False
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
End If
End Sub