Having 2 fields in an e-mail subject line (1 Viewer)

ledmark

Ledmark
Local time
Today, 09:28
Joined
Mar 11, 2008
Messages
127
Hello - I have a form set up so when the sales person enters a date for a follow-up call it generates and e-mail reminder and sends it to the sales person on the day of the follow-up call. For the subject line I have outlook getting the infomation from the ClientStreet field. This works fine.

They would now like me to have both the address and the Project ID show up in the subject line but I have no idea how to add another field to the suject line. This is the code I currently have:

Private Sub FUDateContacted_AfterUpdate()
Dim appOutLook As Object
Dim MailOutLook As Object

Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)

With MailOutLook
.To = Me.EmailRecipient 'get the recipient from the form
.Subject = Me.ClientStreet 'get the street from the form
.body = "This is a reminder that you need to make a follow up call to the address in the Subject line today."
.DeferredDeliveryTime = Me.FUDateContacted 'get the date from the form

.Send
End With

Set appOutLook = Nothing
Set MailOutLook = Nothing
End Sub

Do I have to add another Subject line? or add code to the existing Subject line? I'm a little stuck on how to put in two fields so any help would be very greatly appreciated.

Laura
 

stopher

AWF VIP
Local time
Today, 17:28
Joined
Feb 1, 2006
Messages
2,395
Hi Laura

The subject line is just one line afaik. However, you can build up the string like this:

.Subject = "Project ID:" & me.ProjectID & ", Street Ref: " & Me.ClientStreet

The above would result in the subject being set to:

Project ID: 123, Street Ref: some street


hth
Chris
 

ledmark

Ledmark
Local time
Today, 09:28
Joined
Mar 11, 2008
Messages
127
That did it - thank you so much@!!
 

Users who are viewing this thread

Top Bottom