Hi
Sorry but I'm not to good with macros as don't use them often (other than
autoexec)
It's quite simple to send "stuff" with code - give it a try
1st create the report you want to send
2nd create a form that has (somewhere) the 3 e mail address you want to send
it to (and the CC if you want)
Then use the send object method. If you should search on access help it
will give you a "run though". The code behind the OnClick event would look
something like this
*******
all this goes on 1 line - change the code to the names you have on your form
***********
DoCmd.SendObject acReport, "REPORTNAME", "RichTextFormat(*.rtf)",
Forms!FORMNAME!EMAIL ADDRESS, Forms!FORMNAME!EMAILADDRESS-CC, "", "EMAIL
SUBJECT", "EMAIL CONTENT", False, ""
Notes
"RichTextFormat(*.rtf)" - this would format the report as RTF for Word Doc
but there are other formats such as excel, etc
Forms!FORMNAME!EMAIL ADDRESS - this is the main e mail address the report
will be sent to
Forms!FOEMNAME!EMAILADDRESS-CC - this is used if you want to send a copy of
the report to other address at the same time
"EMAIL SUBJECT" - Insert text between the quotes that you want to apprear in
the Subject line of the email
EMAIL CONTENT" - insert text here that you want to apprear at the top of
the main body of the e mail.
As an example you can use this (on the same line)
"Hi " & [ContactName] & Chr(13) + Chr(10) & Chr(13) +
Chr(10) & "I have sent you this information" & Chr(13) + Chr(10)
&[SomeStuffHere]
The some Stuff Here would be taken from a text box on your form (if you want
- if not then just delete this bit.
The best thing about this is that you can send different messages to
different people - or not - up to you
Hope this helps
--
Wayne
Manchester, England.
LindaBee said:
It is in a macro the macro action is SendObject. I have entered the email
address in the To and I have entered a form field in the Subject which works
it is when I am enter this in the Message text of the macro that is when I
get the error message
Wayne-I-M said:
where have you put this code ?
You say its a macro but this looks (sort of) like an onEvent code
Where am I going wrong. I am entering this in the Message text
Where the Message Text ?
--
Wayne
Manchester, England.
:
I have created a mcaro that sends an email to a manager and have inserted the
email address and subject but I would like to insert text from different
fields but when I try either the text does not display or I get an error
message.
Click OK to return to the action argument or conditional expression where
expression appears, and then correct.
=[txt1] â€& Me.Fname& " “ & Me.txt2 & “ “& Me.[LID (IF KNOWN)]& “ “ & Me.txt3
& “ " &Me. [Job Title] & " “ & Me.txt4 &†" & Me.[Section/Team] & “ " &
Me.txt4 & “ " & Me.txt6
Where am I going wrong. I am entering this in the Message text
Thanks in advance