Hi there im try in to move a whole load of email addresses from a table to an email. I came up with the following:
Private Sub cmdAutoMailout_Click()
Dim db As Database
Dim strSQL As String
Set db = CurrentDb()
strSQL = "SELECT tblcontacts.EastForwardPDF FROM tblcontacts WHERE tblcontacts.EastForwardPDF = Yes"
DoCmd.SendObject acSendNoObject, , , strSQL, , , , , True
End Sub
But this didnt work it only moved the the actual statement into the to field in Outlook. Kinda see how it went wrong, but i dont know how to get the SQL to execute or pick up the names i need. Can anyone help, im a fairly new user to vb and really need some help.
Terminus
Private Sub cmdAutoMailout_Click()
Dim db As Database
Dim strSQL As String
Set db = CurrentDb()
strSQL = "SELECT tblcontacts.EastForwardPDF FROM tblcontacts WHERE tblcontacts.EastForwardPDF = Yes"
DoCmd.SendObject acSendNoObject, , , strSQL, , , , , True
End Sub
But this didnt work it only moved the the actual statement into the to field in Outlook. Kinda see how it went wrong, but i dont know how to get the SQL to execute or pick up the names i need. Can anyone help, im a fairly new user to vb and really need some help.
Terminus