Mailing Only Selected Form Data as a report from a form 
Author Message
 Mailing Only Selected Form Data as a report from a form

I am able to create a report, then create a button on a
form that emails the report as an attachment (it launches
Microsoft Outlook with the attachement). When I click on
the button, I see a grayed out area where I could select
either all records or the current record... It's grayed
out, though, so right now the SendObject command attaches
all records to the email message. I only want the
selected record... so what's the trick to get to the
grayed out settings???


Mon, 29 Aug 2005 02:26:22 GMT  
 Mailing Only Selected Form Data as a report from a form
Normally you would limit the report by using the WhereCondition of the
OpenReport action.

Since you want to use the SendObject instead, you could use one of these
ideas to filter the report:

A) Base the report on a Query, and in the Criteria of the query, refer to
the primary key value of the record in the form. The Critieria would be
something like this:
    [Forms]![MyForm]![MyControl]

B) Use the Open event of the report to set the report's Filter:
    If IsLoaded("MyForm") Then
        Me.Filter = "MyField = " & Forms.MyForm.MyControl
        Me.FilterOn = True
    End If

--
Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to the newsgroup. (Email address has spurious "_SpamTrap")


Quote:
> I am able to create a report, then create a button on a
> form that emails the report as an attachment (it launches
> Microsoft Outlook with the attachement). When I click on
> the button, I see a grayed out area where I could select
> either all records or the current record... It's grayed
> out, though, so right now the SendObject command attaches
> all records to the email message. I only want the
> selected record... so what's the trick to get to the
> grayed out settings???



Tue, 30 Aug 2005 14:24:38 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Selecting data on one form based on a record selected on another form

2. Monthly Report Expense Data Entry-How to Select Month in Form for data entry to table

3. Transfer selected data from primary Form to secondary Form with data update to primary

4. Sorting Data in a report by pre selecting from a form

5. Email form data to users selected in form

6. Multi-select form a query and put into a report using a form

7. Getting multi-select list box to save selected values in form/report

8. Getting multi-select list box to save selected values in form/report

9. Getting multi-select list box to save selected values in form/report

10. Getting multi-select list box to save selected values in form/report


 
Powered by phpBB® Forum Software © phpBB Group