You'll need to learn to start using the help a bit more. It covers the
parameters for the sendobject method in detail.
based on the help file we can get the base synthax for this method which is
expression.SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc,
Subject, MessageText, EditMessage, TemplateFile)
1. so to add a Cc recipient you need only add a 5th variable to your coding
2. We need only concateneate the info on the form into a single string
3. Simple string manip.
4. is controled by the EditMessage boolean value
i. you should start calling you buttons by real names and not the default
values (this will simplify your life when reviewing your code at a later
date, trust me!!!).
Private Sub Command21_Click()
Dim SendTo As String
Dim SendCc As String
Dim MySubject As String
Dim MyMessage As String
SendTo = Me.[Email]
SendCc = "CcRecipientEmailAddressGoesHere"
MySubject = "Complain No :" & Me.[Complain_No]
MyMessage = "Complain No:" & Me.[Complain_No] & vbcrlf & "Customer Name:" &
Me.[Customer_name]
DoCmd.SendObject acSendNoObject, , , SendTo,SendCc , , MySubject, MyMessage,
False
End Sub

Signature
Hope this helps,
Daniel P
> Hi All, I need assistance with the following code am using to send an email
> from my form.
[quoted text clipped - 21 lines]
> 4- I want the email sent directly as soon the user hits send, right now it
> stops for editing.
khashid - 11 May 2007 14:42 GMT
Thanks very much, trust me i love to go through the help files and it always
help me out but at this moment i really didnt have time to do that.
It worked fine thanks again for your help. One last thing if u dont mind
helping me out is when the email is ready if i cancel the email it gives a
run time error that email was canceled and ask to debug
. How can I have some other error so it would not ask for debug or just
simply not to have error
>You'll need to learn to start using the help a bit more. It covers the
>parameters for the sendobject method in detail.
[quoted text clipped - 34 lines]
>> 4- I want the email sent directly as soon the user hits send, right now it
>> stops for editing.
Daniel - 11 May 2007 15:43 GMT
This is called error handling. you need to put in place error handling in
your code (you should do this by default in all your functions...)
Try somthing like the following
Private Sub Command21_Click()
On Error GoTo Command21_Click_Error
Dim SendTo As String
Dim SendCc As String
Dim MySubject As String
Dim MyMessage As String
SendTo = Me.[Email]
SendCc = "CcRecipientEmailAddressGoesHere"
MySubject = "Complain No :" & Me.[Complain_No]
MyMessage = "Complain No:" & Me.[Complain_No] & vbCrLf & "Customer Name:" & _
Me.[Customer_name]
DoCmd.SendObject acSendNoObject, , , SendTo, SendCc, , MySubject, MyMessage,
False
Command21_Click_Error:
If Err.Number = 55 Then
'Nothing need to be done
ElseIf Err.Number <> 0 And Err.Number <> 55 Then
MsgBox "MS Access has generated the following error" & vbCrLf &
vbCrLf & "Error Number: " & _
Err.Number & vbCrLf & "Error Source: Command21_Click" & vbCrLf & _
"Error Description: " & Err.Description, vbCritical, "An Error has
Occured!"
End If
Exit Sub
End Sub
I used err.number 55 (just as an example) but you'll need to enter the
errornumber you are getting.

Signature
Hope this helps,
Daniel P
> Thanks very much, trust me i love to go through the help files and it always
> help me out but at this moment i really didnt have time to do that.
[quoted text clipped - 42 lines]
> >> 4- I want the email sent directly as soon the user hits send, right now it
> >> stops for editing.
Gary Dolliver - 05 Jun 2007 19:47 GMT
Hello Daniel,
I am hoping you may be able to assist me as well. I have been going through
the help files and all of these forums and I am stumped on how to set up a
"sendfrom" line. I am needing this as I will have different emails being
sent from different sections of the program (currently, it will only send
from the default email of Outlook). I would like certain emails to come from
"customer service" and others from "order confirmation" depending on where
the email is being sent from in the program.
Hope you can help and thanks for your time.
-gary
> This is called error handling. you need to put in place error handling in
> your code (you should do this by default in all your functions...)
[quoted text clipped - 78 lines]
> > >> 4- I want the email sent directly as soon the user hits send, right now it
> > >> stops for editing.