Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2005, 01:54 PM
Authorized User
 
Join Date: Aug 2005
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Dharam80
Default

Actually Mike.

If its possible to bypass parameters, than it might work, but I don't know how to do that. Suppose I have a Date Parameter, but sometimes I just want to bypass the parameter and still be able see all the records would be fine. I hope this helps.


Dharmesh Bhavsar
 
Old August 31st, 2005, 01:57 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

OK, I am still having a wee problem with this one, but here is the general idea.

This works fine unless you have previously opened the report - It seems the Open event only fires the first time. I'll keep working on a possible solution, but if anyone else has any bright ideas, that would be great.

Mike

Form with button called cmdEmail
--------------------------------
Private Sub cmdEmail_Click()
On Error GoTo Err_cmdEmail_Click
    Dim newNames As Report
    Dim stDocName As String

    stDocName = "myReport"
    DoCmd.SendObject acReport, stDocName

Exit_cmdEmail_Click:
    Exit Sub

Err_cmdEmail_Click:
    MsgBox Err.Description
    Resume Exit_cmdEmail_Click

End Sub

Private Sub Form_Load()
    txtDate = Format("1/1/1990", "Short Date")
End Sub
---------------------------------
In Load function of report:
---------------------------------
Private Sub Report_Open(Cancel As Integer)
        Me.Filter = "Date >= #" & Form_frmEmail.txtDate & "#"
        Me.FilterOn = True
End Sub
---------------------------------


Mike
EchoVue.com
 
Old August 31st, 2005, 02:05 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

For multiple reports and to hardcode the Email address in, review the code below... This sends the reports to the specified email address, with a subject line and a message. You could add the date variables in here if your manager needs to see the date range. I think that you still have to manually send the email, but there is probably a way around that to - I am not using Outlook right now, so my tinkiering is limited.

Hope that helps,

Mike

Private Sub cmdEmail_Click()
On Error GoTo Err_cmdEmail_Click
    Dim newNames As Report
    Dim stDocName As String

    stDocName = "myReport"
    DoCmd.SendObject acReport, stDocName, acFormatHTML, "[email protected]", , , "Productivity Report", "Insert any message here"
    stDocName = "myReport2"
    DoCmd.SendObject acReport, stDocName, acFormatHTML, "[email protected]", , , "Activity Report", "Insert any message here"


Exit_cmdEmail_Click:
    Exit Sub

Err_cmdEmail_Click:
    MsgBox Err.Description
    Resume Exit_cmdEmail_Click

End Sub

Mike
EchoVue.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
About Mailing List ssomchai BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 May 5th, 2008 10:05 PM
mailing manish_partey ASP.NET 1.0 and 1.1 Professional 1 April 25th, 2007 08:20 AM
Mailing prashanth_kumarbv Classic ASP Basics 2 October 27th, 2006 08:40 PM
E-mailing reports Brendan Bartley Access 5 June 26th, 2006 01:37 PM
SMTP not mailing...help! c_bananas .NET Web Services 5 November 17th, 2003 01:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.