SendObject error

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

Guest

I'm using SendObject to create an email concatenating Email addys from a table.

This is my code:

Dim rs1 As DAO.Recordset
Dim sEmail As String

stSQL = "SELECT FROM tblPerson WHERE (((tblPerson.PracticeID) = " & Me.PracticeID & " ))"

Set rs1 = CurrentDb.OpenRecordset(stSQL, dbOpenSnapshot, dbSeeChanges)

sEmail = ""

Do
sEmail = sEmail & rs1!Email & ";"
rs1.MoveNext
Loop Until rs1.EOF

rs1.Close

DoCmd.SendObject , , , sEmail, , , "Ipswich Diabetes Centre Newsletter", "Attached is a copy of the etc ...", -1

I'm getting the error message:
The command or action 'SendObject' isn't available now.

Any ideas?
 
Could it be that the email string should have commas instead of semicolons?
The SendObject error might be generically telling you that the email cannot go due to the email address(es) being wrong.
Also, you might want to make sure the LAST email in the string does not have any comma (or semicolon).

Tim
 
Back
Top