Add line to Subject in email

S

Stockwell43

Hello,

On my form I have a button with code to send an email to me for the user to
submit a change request form. In the subject, I have Change Request Form but
I also want to add the RecordID number in the subject as well. The RecordID
field is named txtRecordID.

How would I do that so the when I recieve the email it shws Change Request
Form Record ID 2 (or whatever number it is)?

Thanks!!!
 
F

fredg

Hello,

On my form I have a button with code to send an email to me for the user to
submit a change request form. In the subject, I have Change Request Form but
I also want to add the RecordID number in the subject as well. The RecordID
field is named txtRecordID.

How would I do that so the when I recieve the email it shws Change Request
Form Record ID 2 (or whatever number it is)?

Thanks!!!

Crystal ball not working today. Can you send your actual code so we
can see it?
 
S

Stockwell43

Hi Fredg, Thank you for responding.

Here is the code; I want to move the txtRecordID from My Message field to
Subject to she next to Change Request Form. Thanks!!!

Private Sub cmdSendRequest_Click()
On Error GoTo eh
Dim SendTo As String, MySubject As String, MyMessage As String
SendTo = "(e-mail address removed)"
MySubject = "Change Request Form"
MyMessage = MyMessage & vbNullString & vbCr & vbCr & "txtRecordID" & ": " &
Me.txtRecordID
DoCmd.SendObject acSendNoObject, , , SendTo, , , 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
 
F

fredg

Hi Fredg, Thank you for responding.

Here is the code; I want to move the txtRecordID from My Message field to
Subject to she next to Change Request Form. Thanks!!!

Private Sub cmdSendRequest_Click()
On Error GoTo eh
Dim SendTo As String, MySubject As String, MyMessage As String
SendTo = "(e-mail address removed)"
MySubject = "Change Request Form"
MyMessage = MyMessage & vbNullString & vbCr & vbCr & "txtRecordID" & ": " &
Me.txtRecordID
DoCmd.SendObject acSendNoObject, , , SendTo, , , 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

Remove the reference to txtRecordID from the message and place the
txtRecordID value into the subject?

MySubject = "Change Request Form " & Me![txtRecordID]
MyMessage = MyMessage

Is this what you want?
 
S

Stockwell43

Fred,

It works like a charm, thank you so much!!!

I place txtRecordID within the "" instead of out and I did not have the
brackets. :eek:)

fredg said:
Hi Fredg, Thank you for responding.

Here is the code; I want to move the txtRecordID from My Message field to
Subject to she next to Change Request Form. Thanks!!!

Private Sub cmdSendRequest_Click()
On Error GoTo eh
Dim SendTo As String, MySubject As String, MyMessage As String
SendTo = "(e-mail address removed)"
MySubject = "Change Request Form"
MyMessage = MyMessage & vbNullString & vbCr & vbCr & "txtRecordID" & ": " &
Me.txtRecordID
DoCmd.SendObject acSendNoObject, , , SendTo, , , 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

Remove the reference to txtRecordID from the message and place the
txtRecordID value into the subject?

MySubject = "Change Request Form " & Me![txtRecordID]
MyMessage = MyMessage

Is this what you want?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top