If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Pull field into email
Hello,
I am having some trouble with this code. It works fine but my manager wants the project name to show in the email. The button is on the form and when she clicks it the Lead Project person and subject appear. How do I get the project name to pull as well? Here is the code: Private Sub cmdEmail_Click() On Error GoTo EH Dim strDeveloper As String strDeveloper = Me.AssignedTo & "" If strDeveloper vbNullString Then DoCmd.SendObject acSendNoObject, , , strDeveloper, , , "Project Message", "" MsgBox "E-Mail message has been sent to " & strDeveloper & ".", vbInformation, "E-Mail Sent" Else MsgBox "Please designate a LC project lead. ", vbInformation, "Project Lead Missing" End If Exit Sub EH: If Err.Number = 2501 Then MsgBox "This email message has not been sent. Message has been cancelled." End If End Sub Thanks!!!! |
#2
|
|||
|
|||
Pull field into email
Ok, I revised the code but now for somereason I cannot get the cursor to
start After the ProjectName. It start at the beginning of the ProjectName. Here is the new code: Private Sub cmdEmail_Click() On Error GoTo EH Dim SendTo As String, SendCC As String, MySubject As String, MyMessage As String SendTo = Me.AssignedTo MySubject = "Project Information" MyMessage = Me.ProjectName & vbCr DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, SendBCC, MySubject, MyMessage, True EH: If Err.Number = 2501 Then MsgBox "This email message has not been sent. Message has been cancelled." End If End Sub Thanks!!! "stockwell43" wrote: Hello, I am having some trouble with this code. It works fine but my manager wants the project name to show in the email. The button is on the form and when she clicks it the Lead Project person and subject appear. How do I get the project name to pull as well? Here is the code: Private Sub cmdEmail_Click() On Error GoTo EH Dim strDeveloper As String strDeveloper = Me.AssignedTo & "" If strDeveloper vbNullString Then DoCmd.SendObject acSendNoObject, , , strDeveloper, , , "Project Message", "" MsgBox "E-Mail message has been sent to " & strDeveloper & ".", vbInformation, "E-Mail Sent" Else MsgBox "Please designate a LC project lead. ", vbInformation, "Project Lead Missing" End If Exit Sub EH: If Err.Number = 2501 Then MsgBox "This email message has not been sent. Message has been cancelled." End If End Sub Thanks!!!! |
Thread Tools | |
Display Modes | |
|
|