Web Design and Development Forums

E-mailing a report based on current record on form

This is a discussion on "E-mailing a report based on current record on form" within the MSSQL & Access section. This forum, and the thread "E-mailing a report based on current record on form are both part of the Databases category.


Go Back   Webforumz.com > Databases > MSSQL & Access

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Aug 27th, 2007, 23:07   #1 (permalink)
New Member
 
Join Date: Aug 2007
Location: California
Posts: 1
E-mailing a report based on current record on form

Hello all,

I am looking for a way to be able to enter data into fields on a form, then be able to e-mail a report that shows only that record.

This is what I have thus far:

At the end of my Form, I have a Command Button. Right now the Command Button has an On Click... [Event Procedure] to basically E-mail a Report.

Here is my Visual Basic code for it:

Code: Select all
Private Sub Mail_Report_Button_Click()
On Error GoTo Err_Mail_Report_Button_Click

    Dim stDocName As String

    stDocName = "TrainingRequestSingle"
    DoCmd.SendObject acReport, stDocName

Exit_Mail_Report_Button_Click:
    Exit Sub

Err_Mail_Report_Button_Click:
    MsgBox Err.Description
    Resume Exit_Mail_Report_Button_Click
    
End Sub
The Report, "TrainingRequestSingle" basically has all of the Fields that are on the Form.

However, this Report that ends up being e-mailed has all of the Records the Form has total.

I want to to be able to click the Command Button to E-mail the Report which would then show only the current Record being viewed on the Form.

I have another Command Button on the same Form that Prints the current Record only (and not all Records) with success. I have tried manipulating it to work for my E-mailing situation with no success, however.

Here is the Visual Basic code I used in that situation:

Code: Select all
Private Sub Print_Record_Button_Click()
On Error GoTo Err_Print_Record_Button_Click


    DoCmd.OpenReport "TrainingRequestSingle", acViewPreview, , _
    "[TrainingRequestID]=Forms![Training Request Form]!TrainingRequestID"

Exit_Print_Record_Button_Click:
    Exit Sub

Err_Print_Record_Button_Click:
    MsgBox Err.Description
    Resume Exit_Print_Record_Button_Click
    
End Sub
The name of my form is:
Training Request Form

The name of my report is:
TrainingRequestSingle

The name of my e-mail report command button is:
Mail Report Button

I am using Microsoft Access 2002.
easydoesit is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
current, e mail, record, report

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding / Showing form fields based on previous form input John Alexander Hopper PHP Forum 1 Mar 10th, 2008 11:30
[SOLVED] Please help with creating a Mailing list form. Oak New to Web Design 3 Dec 26th, 2007 18:54
Printing single record from Access via Report in Web Page Neotekk JavaScript Forum 0 Jun 18th, 2007 15:20
Opening a specific report by matching user input to report ame autoIT MSSQL & Access 2 Apr 26th, 2007 17:32
form submission and mailing problems........aaaagh Gerry HTML Forum 3 Mar 15th, 2007 10:27



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 17:31.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59