Email current record as a Word doc or Report PLEASE HELP

jenny23

Registered User.
Local time
Today, 11:48
Joined
Apr 1, 2004
Messages
47
Email current record as a Word doc or Report PLEASE HELP
Hello guys,
First of all, I'd like to thank you for all of your help so far....
I 've been trying to create a Review Data Form that lists all records from a table. If a record was emailed already, then it shows "Already sent", if a record is not yet sent, it shows "Not yet sent"....
And, for any record that is not yet sent, I created a button called "Email Now", so that when click on it, it will pop up an Outlook and send out as a attached file.
I found this link, but when I click on it, it sent out the whole report that includes all records,.... do you know how to send out ONLY current record?

http://www.access-programmers.co.uk/forums/showthread.php?t=21816

Thanks.

Jenny.
 
Sounds like you are 90% there.

You will need to limit the Record Source for your report.

Normally you would do this using the WHERE criteria statement in the OpenReport.

However, you may need to limit the record source in the query etc as the WHERE criteria is not available when using the SendObject method.

Let me know if this is not giving you enough of a start.

Brad
 
Can you please show me in details how to show the current row in report?
And, please show me in details.

Thanks.
 
Don't know if this is a any help, but if I want just the current record to print on a report I put a button on the form and then have the on click event do this:

'first save the record to reflect any changes made
DoCmd.RunCommand acCmdSaveRecord

'then preview only records that match the current forms sequence number
DoCmd.OpenReport "report_name",acPreview,,"seq=[forms]![current_form_name]![[seq]
 
First open the report using where condition for current record and then use SendObject for same report. This would solve your problem. Later you can close the opened record after SendObject. e.g:

DoCmd.OpenReport stDocName, acPreview, , "[ref]= Forms!Main_Form!ref"
DoCmd.SendObject acSendReport, stDocName, acFormatRTF
DoCmd.Close acReport, stDocName
(where 'ref' may be the primary id in your table.)
 
Hello friends,
Thank you very much, I appreciated your help so far.
I have one more question:
Now, when I open the button, it open a report and an outlook message to send out that word document. Woh, I like it alot.
However, my question is how to add a message text longer and maybe in more lines?
For example: at the "Attached file is your word document", I want this message like this:
"Greetings from Jenny"
"You have a new message, please click on the attached file for more information about this message..... thank you so much"
"Jenny."

Can I do this? please help, guys.
Thanks, Jenny.

DoCmd.OpenReport stDocName, acViewPreview, , "[Num] = " & Me.Num & ""
DoCmd.SendObject acSendReport, stDocName, "RichTextFormat(*.rtf)", , , , "Message from DB", "Attached file is your word document ", True
 

Users who are viewing this thread

Back
Top Bottom