Adding more fields to send in the email

How do I add more fields from my table to the statement below?

DoCmd.SendObject , , , "John.Anderson@ladwp.com", , , "Mobile Service Request", "Please repair or service this unit: " & (Me![service_id]), False

I am working with a button that I am using to email the current record on a form to a specified user via my default email app (Outlook 2003 on an exchange server).  Here is all of the code from the button in question.

Private Sub Svc_Inv_Click()
On Error GoTo Err_Svc_Inv_Click

    DoCmd.SendObject , , , "John.Anderson@ladwp.com", , , "Mobile Service Request", "Please repair or service this unit: " & (Me![service_id]), False
         
Exit_Svc_Inv_Click:
    Exit Sub

Err_Svc_Inv_Click:
    MsgBox Err.Description
    Resume Exit_Svc_Inv_Click
   
End Sub

Thanks in advance for the help.  I have used access with the wizard stuff for sometime, however this is my first time needing to do something with visual basic code.
   
jande2Asked:
Who is Participating?
 
flavoCommented:
Sure:


    DoCmd.SendObject , , , "John.Anderson@ladwp.com", , , "Mobile Service Request", "Please repair or service this unit: " & _
            "Service Order # " &  Me.[service_id] & ", Name " & Me.[user_name] & _
             " , Tech " & Me.[staff_id] & " , SN " &  Me.[sn_no] & ", Mach Name " & Me.[mach_name], False

Dave
0
 
flavoCommented:
What fields?  And where do you want them - subject / msg body??

Dave
0
 
jande2Author Commented:
I want to place all of the fields I want to send in the message body.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
flavoCommented:
Something like:


    DoCmd.SendObject , , , "John.Anderson@ladwp.com", , , "Mobile Service Request", "Please repair or service this unit: " & Me![service_id] &_
 Me![SomeOtherField] & Me![SomeOtherFeildHereToo], False

If you post back the exact field names, and the order you want them in, including any other text (such as commas between the field text etc...) I can post back something you should be able to copy and paste right in

Dave
0
 
jande2Author Commented:
The fields I have are [service_id] [user_name] [staff_id] [sn_no] [mach_name]

I would like to separate them with a label for each field such as:

"Service Order #" [service_id], "Name"[user_name],"Tech" [staff_id], "SN" [sn_no], "Mach Name" [mach_name]

Is this possible?

Thanks
0
 
jande2Author Commented:
Thanks for all of your help.  This does exactly what i need it to do.
0
 
flavoCommented:
Glad to help mate

Dave :^)
0
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.

All Courses

From novice to tech pro — start learning today.