![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
Well I was miraculously successful
For those in the same boat as me here's what I had to do
From the visual basic editor got to tools and then reference
add Microsoft DAO 3.6
Microsoft Outlook 9.0
Microsoft Access 9.0 Object Library
Im not exactly sure which one of these makes it possible I believe the Access Library anyways
I do not think it hurts you to add all three.
Maybe someone would care to comment
I built a query to get the email addresses I was look for.
I created a button on a form and then right clicked on it
and hit build event then I chose code builder and added the following code to it.
Private Sub Command4_Click()
On Error GoTo email_minor_league_tryouts_Err
Dim Db As Database
Set Db = CurrentDb
'"BroadCast Email List to All" this is the name of my query
'But do this individually so only one address per email
Set Rst = Db.OpenRecordset("BroadCast Email List to All", dbOpenDynaset)
'do the loop until all records are done
While Not Rst.EOF
'email is the field name in the query "BroadCast Email List to All"
EmailList = Rst!email
'"Report1" is the name of the txt file being attached
'EmailList holds the individual email address
'etc
'DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][, bcc][, subject][, messagetext][, editmessage][, templatefile]
DoCmd.SendObject acReport, "Report1", "MS-DOSText(*.txt)", EmailList, "", "", "Minor League Tryouts", "Minor League Tryouts will be Saturday March 23 from 9-11am Please bring a glove.", False, ""
'go to the next record in the query
Rst.MoveNext
Wend
email_minor_league_tryouts_Exit:
Exit Sub
email_minor_league_tryouts_Err:
MsgBox Error$
Resume email_minor_league_tryouts_Exit
End Sub
the dang thing works!!!!
its like magic when this stuff happens
armstrong
ps i added the type of comments I need as a rookie programmer im not sure if this forum will add enters on the line wraps if the line is to long for the window, so please be careful fellow newbies...