Hi Guys,
Me again - Still stuck i'm afraid!
This time i've got the email to display the number of records, however all it does is duplicate the first record data! For example, the query pulls out 150 records and the first record is a document on DPA - the title is repeated 150 times instead of displaying each individual title!
Have i placed the loop in the correct place?
[blue]Private Sub cmdSendEmail1_Click()
Dim db As DAO.Database
Set db = CurrentDb
Dim sEmail As String
Dim sBody As String
'Dim sQMRef As String
Dim recset As DAO.Recordset
Dim recCount As Integer
'recCount = 0
'creates variables for Outlook
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
'**gathers information from the form
sEmail = "janet@****.com"
'sQMRef = Me!Title & Me!StaffName
sBody = sBody & "Hi Janet," & vbCrLf & vbCrLf & "The following document/s need reviewing and updating. Please forward the information to the relevant author

" & _
vbCrLf & vbCrLf
Set recset = CurrentDb.OpenRecordset("qryFirstNotice")
While Not recset.EOF
'recCount = recCount + 1
sBody = sBody & Me!Title & Me!StaffName & vbCrLf
recset.MoveNext
Wend
'**creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
'***creates and sends email
With objEmail
.To = sEmail
.Subject = "Quality Manual Documents Needing Reviewing"
.Body = sBody
.Display
End With
Set objEmail = Nothing
Exit Sub
End Sub
[/blue]
I'm assuming the part in bold is the bit that needs work!!
Thanks
