Hi All,
I have written a code on a button to automatically put details from my database into an email.
I had the code working, however I was not able to format any of it, and from research I believe it is because I did not have it in HTML format.
I have changed my code to HTML, however now it is not pulling the actual data and instead is just leaving it as (Example) & Me.Internal_Unit_Code.
I have popped the code below, if anyone is able to tell me where I am going wrong (Again :banghead
It would be greatly appreciated.
Private Sub Send_for_Review_Click()
Dim appOutlook As New Outlook.Application
Dim objEmail As Outlook.MailItem
Set objEmail = appOutlook.CreateItem(olMailItem)
With objEmail
.BodyFormat = olFormatHTML
.HTMLBody = "Dear < br <> br > Please see below details of a precedent that requires your review.<br><br>Attached is the documentation that was used for the previous assessment of this precedent.<br><br><b>Internal Unit Code:</b> & [Me.Internal_Unit_Code]<br><b>Internal Unit Title:</b> & Me.Internal_Unit_Title<br><b>External Unit Code:</b> & Me.External_Unit_Code<br><b>External Unit Title:</b> & Me.External_Unit_Title <br><b>External Institution:</b> & Me.External_institution<br><b> Precedent Linked to specific course, Major and/Or Stream:</b> & Me.Course_Major_Stream_Code<br><b>Years/s basis unit was complete:</b> & Me.Year_s_Basis_Unit_Completed<br><b> Previously assessed by:</b> & Me.Precedent_assessed_by <br><b> Date of last assessment: </b> & Me.Date_Assessed <br><br> If you could please review this precedent and return the outcome to us within 5 working days"
.Display
End With
End Sub
I have written a code on a button to automatically put details from my database into an email.
I had the code working, however I was not able to format any of it, and from research I believe it is because I did not have it in HTML format.
I have changed my code to HTML, however now it is not pulling the actual data and instead is just leaving it as (Example) & Me.Internal_Unit_Code.
I have popped the code below, if anyone is able to tell me where I am going wrong (Again :banghead

Private Sub Send_for_Review_Click()
Dim appOutlook As New Outlook.Application
Dim objEmail As Outlook.MailItem
Set objEmail = appOutlook.CreateItem(olMailItem)
With objEmail
.BodyFormat = olFormatHTML
.HTMLBody = "Dear < br <> br > Please see below details of a precedent that requires your review.<br><br>Attached is the documentation that was used for the previous assessment of this precedent.<br><br><b>Internal Unit Code:</b> & [Me.Internal_Unit_Code]<br><b>Internal Unit Title:</b> & Me.Internal_Unit_Title<br><b>External Unit Code:</b> & Me.External_Unit_Code<br><b>External Unit Title:</b> & Me.External_Unit_Title <br><b>External Institution:</b> & Me.External_institution<br><b> Precedent Linked to specific course, Major and/Or Stream:</b> & Me.Course_Major_Stream_Code<br><b>Years/s basis unit was complete:</b> & Me.Year_s_Basis_Unit_Completed<br><b> Previously assessed by:</b> & Me.Precedent_assessed_by <br><b> Date of last assessment: </b> & Me.Date_Assessed <br><br> If you could please review this precedent and return the outcome to us within 5 working days"
.Display
End With
End Sub