S
stockwell43
Hello,
Sorry to report this but I really need some help. I am working on a database
that was someone else's and the manager clicks the email button on the form,
she wants it to also show the project name. I eventually figured out how to
do it and keep everything working properly. However, when the email opens the
cursor is at the beginning of the project name and I need it to start on the
next line. When I try to do it using the following code I get a complie
error, expected expression. The line that reads: MyMessage = Me.ProjectName &
vbCr & is highlighted in red. If I remove the & at the end the red goes away
ant the code works again but it doesn't drop the cursor to the next line.
Could someone please tell me what I am doing wrong? Any help would be most
appreciared!! Thank in advanced!
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
Sorry to report this but I really need some help. I am working on a database
that was someone else's and the manager clicks the email button on the form,
she wants it to also show the project name. I eventually figured out how to
do it and keep everything working properly. However, when the email opens the
cursor is at the beginning of the project name and I need it to start on the
next line. When I try to do it using the following code I get a complie
error, expected expression. The line that reads: MyMessage = Me.ProjectName &
vbCr & is highlighted in red. If I remove the & at the end the red goes away
ant the code works again but it doesn't drop the cursor to the next line.
Could someone please tell me what I am doing wrong? Any help would be most
appreciared!! Thank in advanced!
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