Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reference First name in email heading

Posted on 2013-01-29
5
Medium Priority
?
325 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 1000 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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

618 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