A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Pull field into email



 
 
Thread Tools Display Modes
  #1  
Old March 9th, 2009, 04:52 PM posted to microsoft.public.access
Stockwell43
external usenet poster
 
Posts: 579
Default 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  
Old March 9th, 2009, 06:19 PM posted to microsoft.public.access
Stockwell43
external usenet poster
 
Posts: 579
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.