Solved

Reference First name in email heading

Posted on 2013-01-29
5
286 Views
Last Modified: 2013-01-29
I have an email button that is working properly. I would like it to start referencing the clients first name in the heading. Below is some of the code. Instead of saying "<HTML>Dear Big Arms Swimmers Client,<BR><BR><BR>" . I'd like it to say "Dear <CLIENTFIRSTNAME>

How would I reference that information in the form?



Private Sub Command108_Click()
Dim objOutlook As Object, objEmailMessage As Object

Dim sSubj As String, sBody As String
sSubj = "Swim Lesson Policy at Coto Valley Country Club"


sBody = "<HTML>Dear Big Arms Swimmers Client,<BR><BR><BR>" _
            & "<P>Thanks for signing up for swim lessons at Coto Valley Country Club, " _
            & "we are sure you are going to enjoy your experience at one of the premier country clubs " _
            & "in the area. Your purchase of swim lesson will allow your child the opportunity use " _
            & "the pool during the allotted swim lessons time.</P><BR>The country club is designed to " _
            & "be very affordable option for local families (both in and outside of the gates " _
0
Comment
Question by:cansevin
  • 3
5 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 250 total points
ID: 38831428
strFirstName=dlookup("FirstName", "tableName","<criteria>)

sBody = "<HTML>Dear " & strFirstName & ",<BR><BR><BR>" _
0
 

Author Comment

by:cansevin
ID: 38831440
Thanks Capricorn... is there anything in the "<criteria>" part?
0
 
LVL 61

Accepted Solution

by:
mbizup earned 250 total points
ID: 38831495
If  the form containing this button already contains client information, you can refer to the ClientFirstName field directly like this:


sBody = "<HTML>Dear " & Me.[txtFirstName] & ",<BR><BR><BR>" _

Open in new window



Replace txtFirstName with the actual name of the textbox containing your client first name
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38831496
that is where you set the criteria to get the correct Name form the records..
it could be the unique ID that is currently displayed in your form

strFirstName=dlookup("FirstName", "tableName","ID=" & me.ID)
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38831502
hmmm.....;-)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question