Send email

Hi I have the following codes to send email after choice is made yes, no. I would like to add from the form the following fields: name, Services date, typeID with thier lables. Any suggestions?

  Dim strSubject As String
  Dim Mymessage As String
  strSubject = "Service needed"


Mymessage = "Dear, " & vbCrLf
Mymessage = Mymessage & " " & vbCrLf
Mymessage = Mymessage & " " & vbCrL
Mymessage = Mymessage & "Please coordinate nessacery arrangement......" & vbCrLf
Mymessage = Mymessage & " " & vbCrLf
Mymessage = Mymessage & "Thanks." & vbCrLf

Mymessage = Me.Name
Mymessage = Me.ServiceDate
Mymessage = Me.TypeID

Thanks
Eddy2010Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mbizupCommented:
Assuming that you are running this from a command button or other event on the same form, try this:

  Dim strSubject As String
  Dim Mymessage As String
  strSubject = "Service needed"


Mymessage = "Dear, " & vbCrLf
Mymessage = Mymessage & " " & vbCrLf
Mymessage = Mymessage & " " & vbCrL
Mymessage = Mymessage & "Please coordinate nessacery arrangement......" & vbCrLf
Mymessage = Mymessage & " " & vbCrLf
Mymessage = Mymessage & "Thanks." & vbCrLf & vbcrlf

Mymessage =Mymessage & "Name: " &  Me.Name & vbcrlf
Mymessage =Mymessage & "Service Date: " &  Me.ServiceDate & vbcrlf
Mymessage =Mymessage & "Type ID: " & Me.TypeID



0
mbizupCommented:
If the code is on a different form, use the full form reference instead of "Me.":

Mymessage =Mymessage & "Name: " &  Forms!YourFormName.Name & vbcrlf
Mymessage =Mymessage & "Service Date: " &  Forms!YourFormName.ServiceDate & vbcrlf
Mymessage =Mymessage & "Type ID: " & Forms!YourFormName.TypeID

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Eddy2010Author Commented:
Thank you. That worked perfectly.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.