I have a form that, when the button (command24) is clicked, I want it to send an email, then select a new record for data entry.
What it does right now is outputs exactly what I want into an email where the user can then click send, then resumes the form at a new record. Everything works as desired, except I'd rather it just bypass the "send" step and place the email in the outbox, so the user never actually sees the email.
Is there a way to do this?
Also if possible I would like to find a way to email this without the attachment, as I include all info in the body of the email.
Private Sub Command24_Click()
On Error GoTo Err_Command24_Click
Dim stDocName As String
Dim stEmail As String
Dim stSubject As String
Dim stbody As String
stDocName = "frm_ChangeRequest"
stEmail = "firstname.lastname@example.org"
stSubject = "Change Request For " & Me!UserInQuestion & "," & Me!CurrentDate
stbody = ("Name: " & Me!UserInQuestion & vbCrLf & _
"Reason: " & Me!ErrorDescription & vbCrLf & _
"Sent From: " & Me!LoginName & " - " & Me!UserName & vbCrLf & _
"On Computer " & Me!ComputerName & vbCrLf & _
"at " & Me!CurrentTime)
DoCmd.SendObject acSendForm, stDocName, acFormatPDF, stEmail, , , stSubject, stbody, , False
DoCmd.GoToRecord , , acNewRec
Last edited by Pat Phelan; 01-17-11 at 23:56.
Reason: User (Chris07tibgs) request