kathildreth2003
MIS
What I am trying to do is create a form in access, and send the form to an email address by using a tab button.
So that the form is sent in an email
So that the form is sent in an email
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Submit_Click()
Dim appOutlook As Outlook.Application
Dim ItmNewEmail As Outlook.MailItem
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 'save record before proceeding
Set appOutlook = New Outlook.Application
Set ItmNewEmail = appOutlook.CreateItem(olMailItem)
With ItmNewEmail
.To = "add1@domain.com; add2@domain.com"
.CC = Forms("FormName").Controls("RequestorEmail").Value
.Subject = "Subject"
.Body = "A new email has been sent by" & Forms("FormName").Controls("ControlName").Value & " for Job Number " & Forms("FormName").Controls("ControlName").Value & Chr(13) & "sample text" & Forms("FormName").Controls("ControlName").Value & Chr(13) & Chr(13) & Forms("FormName").Controls("ControlName") & Chr(13) & "More Sample Text " & Forms("FormName").Controls("ControlName") & Chr(13) & Chr(13) & Forms("FormName").Controls("ControlName")
.Send ' send files and notification
End With
End Sub
.Body = "Type some sample text here, make sure that it is in quotes " & Forms("Some Form).Controls("Some Control").Value & " Make sure you include spaces at beginning and end of text strings where appropriate or else you will see twowordsrightnext to each other in the email " & Chr(13) & " Chr(13) serves to skip a line " & Forms("Some Form").Controls("Some Control").Value
.Body = Forms("MyForm").Controls("EmployeeName").Value & " has requested a " & Forms("MyForm").Controls("ShiftSwapOrHoliday").Value & " on " Forms("MyForm").Controls("RequestedDate").Value & "." & Chr(13) & Chr(13) & "This request was made on " & Forms("MyForm").Controls("SubmissionDate") & " at " & Forms("MyForm").Controls("SubmissionTime")