Private Sub Email_these_students_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strEmail As String
Dim strMessage As String
Const NL = vbCrLf & vbCrLf
Const Subject = "Proof of benefit required"
Const Part1 = "According to our records, you are enrolled on the "
Const Part2 = " course at the college."
Const Part3 = "When you enrolled, you informed us that you where in receipt of a Mean Tested Benefit. You have not however, shown the college proof that you are in fact in receipt of this benefit."
Const Part4 = "Can you therefore please take proof of your benefit with you to the Information & Guidance desk as soon as possible, along with this e-mail."
Const Part5 = "Failure to provide this proof, will result in you being invoiced with the next 14 days for the course fee, which is £"
Const Part6 = "Should you have any queries regarding this e-mail, please contact the Finance Office on (01642) 865428."
Set db = CurrentDb
Set rs = db.OpenRecordset("Q_Students on DB > 21 days and not <19yrs")
Do While Not rs.EOF
strEmail = rs.Fields("E-Mail")
strMessage = "Dear " & Me.[Forename_s_] & NL & Part1 & Me.CourseTitle & Part2 & _
NL & Part3 & NL & Part4 & NL & Part5 & Me.CourseFee & NL & Part6
DoCmd.SendObject , , acFormatTXT, strEmail, , , Subject, strMessage, False
rsEmail.MoveNext
Loop
MsgBox "Emails have been sent"
Set rs = Nothing
Set db = Nothing
End Sub