Solved

Reference First name in email heading

Posted on 2013-01-29
5
263 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 119

Assisted Solution

by:Rey Obrero
Rey Obrero 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 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now