Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emailing report using SendObject 1

Status
Not open for further replies.

plcman

Programmer
Feb 17, 2001
92
GB
I have a button that generates a report and sends it by email as a snapshot attachment. My problem is that instead of sending only the record shwoing, all the records in the table are sent.

I tried adding a filter bu I got an error message saying that it was not allowed.

Below is the code I have at present.

Dim stDocName As String

stDocName = "Certificate"
DoCmd.SendObject acReport, stDocName, acFormatSNP

Any help would be appreciated.
 
You could base your report on a query that references the ID of the record showing.
 
Is there an Access MDB equivalent of SQL Server's xp_smtp_sendmail, where you don't need an email client (like Outlook) to send mails from within Access?
 
Do a search for CDO

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Im using MS Access 2000 on a Windows XP Pro and referenced MS CDO for Windows 2000 Library. And did the following:
Code:
Public Sub EmailReport()
    Dim Email As CDO.Message
    Set Email = New CDO.Message
    Email.From = "ronspree@domain.com"
    Email.To = "ronspree@domain.com"
    Email.Subject = "MS Access CDO Mail Message"
    Email.TextBody = "The quick brown fox jumped over the lazy dog."
    
    Email.Send
End Sub
I get an error message saying that the "SendUsing" configuration value is invalid. How do I correct this? Maybe I need to specify the SMTP server? How do I do that?
 
Maybe I need to specify the SMTP server?
Email.Configuration.Fields.Item (" = x
Email.Configuration.Fields.Item (" = "xx.xx.x.xx"
Email.Configuration.Fields.Item (" = xx
Email.Configuration.Fields.Update

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Wow, that's amazing syntax. What do I put under SendUsing? I have the smtp url (or its ip address equivalent) for smtpserver, and the serverport is 25.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top