Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a form where I have 2 text b

Status
Not open for further replies.

armstrong722

Technical User
Feb 26, 2002
32
0
0
US
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
 
sorry the green line should be replaced with this that does work

DoCmd.SendObject acReport, "Report1", "MS-DOSText(*.txt)", EmailList, "", "", "Minor League Tryouts", "Minor League Tryouts a glove.", False, ""
 
acSendNoObject
instead of acreport

never mind
[smiley]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top