I'm pretty certain that the "send report" option is only meant to send
out Access reports as either Spreadsheets, Snapshots (a PDF type file
format that is specific to Access and requires a free Snapshot viewer
download from Microsoft), or some other predefined format.
I think your best bet is your 2nd option, though you would have to
create a "Send mail" type function, it is completely possible to
automate. Here is some sample code taken from a procedure I have
implemented, hopefully you can use it as a model and I can help you
fill in any blanks.
one thing to note, is that you will need to go into Tools ->
References in the VBA editor and include Microsoft Outlook 11.0 Object
Library (or whichever version you have installed - hopefully the code
will work with any of them)
Dim appOutlook As Outlook.Application
Dim olMailItem As Outlook.MailItem
Dim rsRecipients as Recordset, rsFiles as recordset
Set appOutlook = CreateObject("Outlook.Application")
Set olMailItem = appOutlook.CreateItem(0)
'retrieve a list of email address that you are sending files to
set rsRecipients = currentdb.openrecordset("Select fld_PersonNameorID,
fld_EmailAddress from tbl_TableName GROUP BY fld_EmailAddress;")
rsRecipients.movefirst
With olMailItem
do until rsrecipients.eof
.To = 'Need code to fill in email address from your database
.Subject = "SUBJECT LINE"
Set rsFiles = currentdb.openrecordset("Select fld_FileNames from
tbl_Tablename where fld_responsibleparty = '" &
rsrecipients("fld_PersonNameorID") & "'"
rsFiles.movefirst
do until rsFiles.eof
.Attachments.Add Source:= rsFiles("fld_FileNames")
rsFiles.movenext
loop
.send
rsRecipients.movenext
loop
End With
Set olMailItem = Nothing
Set appOutlook = Nothing
This should give you a good starting point, but you'll obviously have
to do some filling in of the fied and table names. Let me know if
this produces any errors and I'll see what I can do ... try to CC me
directly and I'll better know if you need further assistance.
On Feb 28, 5:56 pm, "Janet...@googlemail.com"
<Janet...@googlemail.com> wrote:
> Hi All,
>
[quoted text clipped - 26 lines]
>
> Sven