emailing reports

planetcoffee

New member
Local time
Today, 14:46
Joined
Jul 26, 2001
Messages
8
My report emails fine but i want to be able to automatically name the file with a name and a number that it gets from a form. (example name23....the number 23 comes from the form). I want this number to be able to change depending on that field in the form. Does anyone know what I am talking about and could you help me out. Thanks.
 
planetcoffee, I can get you started with this:

Dim strNewRepName As String

strNewRepName = Me.txtBox1.Value ' text box from form.

DoCmd.Rename strNewRepName, acReport, "UseYourReportNameHere" ' Renames the report based on string. You may want to keep a template stored somewhere to keep the original report and its name intact.

DoCmd.SendObject acReport, strNewRepName, "RichTextFormat(*.rtf)", _
"email@your.com", , , , , True ' sends new named object with email.

The problem with this is that the file that is sent in rtf format is getting its name from the caption property of the report and not the actual name of the report. You are going to have to set the caption property of the report to the strNewRepName variable. So far I haven't been able to get that accomplished succesfully.

There may be a better way so I will leave you with this and see if some one has a better answer or a fix for mine.

[This message has been edited by Talismanic (edited 07-26-2001).]
 

Users who are viewing this thread

Back
Top Bottom