• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 329
  • Last Modified:

Reference First name in email heading

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
cansevin
Asked:
cansevin
  • 3
2 Solutions
 
Rey Obrero (Capricorn1)Commented:
strFirstName=dlookup("FirstName", "tableName","<criteria>)

sBody = "<HTML>Dear " & strFirstName & ",<BR><BR><BR>" _
0
 
cansevinAuthor Commented:
Thanks Capricorn... is there anything in the "<criteria>" part?
0
 
mbizupCommented:
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
 
Rey Obrero (Capricorn1)Commented:
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
 
Rey Obrero (Capricorn1)Commented:
hmmm.....;-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now