Hi -
I know I can use the below code to populate a textbook from a recordset (i.e. query results)
Code:
Set rs = db.OpenRecordset("qryData")
If Not (rs.BOF And rs.EOF) Then
rs.MoveLast
rs.MoveFirst
While (Not rs.EOF)
Me.txtbox1 = Me.txtbox1 & vbCrLF & Space(7) & rs![public systems.entity number] & " - " & rs![public systems.employee id] & vbCrLF
rs.MoveNext
Wend
End If
However, how can I adapt this (or if someone has an easier method I'm down, to use the data from the query above in the body of my outlook email?
This is how I currently populate an outlook email from access vba
Code:
Dim oApp As Outlook.Application
Dim oMail As MailItem
Set oApp = CreateObject("Outlook.application")
Set oMail = oApp.CreateItem(olMailItem)
oMail.Subject = "Subject"
oMail.To = "SendTo"
oMail.Body = "Body of Email"
oMail.Send
Set oMail = Nothing
Set oApp = Nothing