If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
'send copy of feedback to tutor by email
Dim TutorEmail As String
Dim FeedBackMail As String
Dim msg As String
Dim subj As String
Dim r As Long
Dim EmailToStudent As Boolean
If Nz(Me![Primary Email], "") <> "" And Me![Feedback Method] = "Email"
Then
EmailToStudent = True
Else
EmailToStudent = False
End If
If EmailToStudent Then
msg = "Would you like to email the student"
msg = msg & vbNewLine
msg = msg & "or print preview the report?"
msg = msg & vbNewLine & vbNewLine
msg = msg & "Yes to email them"
msg = msg & vbNewLine
msg = msg & "No to print preview"
msg = msg & vbNewLine
msg = msg & "or cancel"
r = MsgBox(msg, vbYesNoCancel + vbQuestion, "Email to Student")
Select Case r
Case vbYes
EmailToStudent = True
Case vbNo
EmailToStudent = False
Case vbCancel
GoTo btnFeedbackScores_Click_exit
End Select
End If
If EmailToStudent Then
msg = "Hi " & Nz(Me![Nickname], Me![Forename]) & ","
msg = msg & vbNewLine & vbNewLine
msg = msg & "You will find attached the marks & feedback for module "
& Me![cboModule] & " which you submitted recently."
msg = msg & vbNewLine & vbNewLine
msg = msg & "This message has been sent from the Administration
offices. If you have and comments or wish to discuss the feedback please
contact your tutor, and not the office. Your tutor will have been sent a
copy of this message. "
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & "The attached file is in Microsoft Snapshot format, and if
you have Microsoft Access installed on your computer you should be able to
read the file. However, if it is not installed, or you are having any
difficulty in opening or reading the file, please go to the Student
Resources Area of the xxx web site where you will be able to download the
snapshop viewer free of charge."
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & vbNewLine & vbNewLine
msg = msg & "Administration Team"
subj = "Feedback for Module " & Me![cboModule]
DoCmd.SendObject acSendReport, "rptStudentMarkingFeedbackLetter",
"Snapshot Format (*.snp)", Me![Primary Email], , , subj, msg, True
Else
DoCmd.OpenReport "rptStudentMarkingFeedbackLetter", acViewPreview, , ,
acDialog
End If
Me![StuModFeedbackSentOn] = Now()
TutorEmail = Nz(DLookup("(e-mail address removed)