Solved

Reference First name in email heading

Posted on 2013-01-29
5
310 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

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!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

705 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