Im now trying to implement the code using Access levels works to a degree but ive got something around the wrong way, it loads outlook how i want it just doesn't put the subject and body message in now.
Code:
Private Sub Command265_Click() On Error Resume Next
Dim sMsgBody As String
Dim sSubject As String
Dim iAccLvl As Integer
sSubject = "Process Order" & " - " & Me.cboLookup7.Column(1)
sMsgBody = "Hi," _
& vbNewLine & vbNewLine & "Attached is Purchase Order, can you please proceed." _
& vbNewLine & vbNewLine & "Thankyou." _
& vbNewLine & vbNewLine & "Regards," _
& vbNewLine & [Forms]![LoginForm]![cboUser].[Column](1) _
& vbNewLine & vbNewLine & "This email is automatically generated by Access, if you are not the Recipient please reply back to email or contact us." _
& vbNewLine & "Cabinets" _
& vbNewLine & "(08) "
iAccLvl = DLookup("[AccessLevel]", "tblEmployees", "[EmployeeID_PK] = " & Forms!LoginForm!cboUser)
Select Case iAccLvl
Case 1, 2, 3
DoCmd.SendObject acReport, "rptOrderEmail", acFormatPDF, , , , sSubject, sMsgBody, True
Case Else
MsgBox "You Do not have Permissions", vbOKOnly
End Select
End Sub