armstrong722
Technical User
I have a form where I have 2 text boxes accepting subject and title for an email. this is what i have in my code
Private Sub Email_Everyone_Click() 'EmailSubject, EmailMessage
On Error GoTo Email_Everyone_Click_Err
Dim Db As Database
Set Db = CurrentDb
Set Rst = Db.OpenRecordset("Email Test pierre", dbOpenDynaset)
'do the loop until all records are done
While Not Rst.EOF
Dim subject As Variant
Dim message As Variant
subject = EmailSubject 'EmailSubject is a textbox in the form
message = EmailMessage 'ditto
EmailList = Rst!email
DoCmd.SendObject acReport, , , EmailList, "", "", subject, message, False, ""
DoCmd.SendObject acReport, , , EmailList, "", "", "Minor League Tryouts", "Minor League Tryouts will be Saturday March 23 from 9-11am Please bring a glove.", False, ""
Rst.MoveNext
Wend
Email_Everyone_Click_Exit:
Exit Sub
Email_Everyone_Click_Err:
MsgBox Error$
Resume Email_Everyone_Click_Exit
End Sub
why does green work and red does not
When i set up the watches for all the variable they are all filled in and look correct
I'm really stumped
armstrong
Private Sub Email_Everyone_Click() 'EmailSubject, EmailMessage
On Error GoTo Email_Everyone_Click_Err
Dim Db As Database
Set Db = CurrentDb
Set Rst = Db.OpenRecordset("Email Test pierre", dbOpenDynaset)
'do the loop until all records are done
While Not Rst.EOF
Dim subject As Variant
Dim message As Variant
subject = EmailSubject 'EmailSubject is a textbox in the form
message = EmailMessage 'ditto
EmailList = Rst!email
DoCmd.SendObject acReport, , , EmailList, "", "", subject, message, False, ""
DoCmd.SendObject acReport, , , EmailList, "", "", "Minor League Tryouts", "Minor League Tryouts will be Saturday March 23 from 9-11am Please bring a glove.", False, ""
Rst.MoveNext
Wend
Email_Everyone_Click_Exit:
Exit Sub
Email_Everyone_Click_Err:
MsgBox Error$
Resume Email_Everyone_Click_Exit
End Sub
why does green work and red does not
When i set up the watches for all the variable they are all filled in and look correct
I'm really stumped
armstrong