Help with OutputTo SendTo Action/Method - Multi-post 
Author Message
 Help with OutputTo SendTo Action/Method - Multi-post

I would like to get some guidance as to how to accomplish the follow;

From: -- a Report View where only Selected records are previewed
Achieve: -- Convert the current preview into a HTML document that is either
saved or sent via e-mail.

Currently, I have no problems outputting the ENTIRE Report. I can't seem to
find a way to filter the output easily.
The only way I can see is through a Param. Query and this is not an ideal
solution.

Solutions in VB welcome, if any.

I am working with Access 2000.

Any ideas?

--
Jeff Watkins
Labrug - Computer Consultant and Trainer

040809 4899



Mon, 01 Aug 2005 14:07:59 GMT  
 Help with OutputTo SendTo Action/Method - Multi-post
on the open event of the report, you can open a small criteria form (dialog
mode) to enter criteria(s) and pass it to a 'public' variable. Then use this
variable as the filter property of the current report.

steps;

'in a "module" declare strCRIT

Public strCRIT as String 'criteria used in the open event of the report

----------------------------------------------
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmCRIT", , , , , acDialog      ' code stops here until the
criteria form is closed
Me.Filter = "CustomerID=" & strCRIT
Me.FilterOn = True
End Sub
----------------------------------------------

'Criteria Form's close event
'cmbCRIT is a combo box on the criteria form, its row source may be the list
of CustomerIDs

Private Sub Form_Close()
strCRIT = Me.cmbCRIT
End Sub
----------------------------------------------


Quote:
> I would like to get some guidance as to how to accomplish the follow;

> From: -- a Report View where only Selected records are previewed
> Achieve: -- Convert the current preview into a HTML document that is
either
> saved or sent via e-mail.

> Currently, I have no problems outputting the ENTIRE Report. I can't seem
to
> find a way to filter the output easily.
> The only way I can see is through a Param. Query and this is not an ideal
> solution.

> Solutions in VB welcome, if any.

> I am working with Access 2000.

> Any ideas?

> --
> Jeff Watkins
> Labrug - Computer Consultant and Trainer

> 040809 4899



Mon, 01 Aug 2005 21:11:15 GMT  
 Help with OutputTo SendTo Action/Method - Multi-post
Do you mean to tell me that the outputto and sendto actions/methods invoke
the open report action?

--
DO NOT USE REPLY
Please note that the reply address is false
in order to avoid spam mail. Please ensure that
any reply mail uses the below address.
-----------------------------------------
Jeff Watkins
Labrug - Computer Consultant and Trainer

040809 4899

Quote:
> on the open event of the report, you can open a small criteria form
(dialog
> mode) to enter criteria(s) and pass it to a 'public' variable. Then use
this
> variable as the filter property of the current report.

<<< REST SNIPPED >>>


Tue, 02 Aug 2005 14:38:48 GMT  
 Help with OutputTo SendTo Action/Method - Multi-post
Jeff,

If I understand right, you may be having the same problem I had.
Namely, I can set all the filters I want for my report when I open it
by passing a valid Where clause in the Open event of the report.
Displays just great in the report, but that is definitely NOT what I
get when I e-mail it.  The e-mailed version is not filtered.  The way
I was told to fix it was to base the report I'm exporting on a holder
query and to change the recordsource of the query on the fly.  Lyle
Fairfield posted a big chunk of code that does that.  If you look for
a thread that he and I participated in and something like "e-mail" or
"export", you should find the code.  In a word, Access somehow
"forgets" to add the filter when it exports the records in the report,
so you get everything, and not just what you asked for.

If you need the code, post back.  Lyle and I have it somewhere.

HTH,
Pieter



Wed, 03 Aug 2005 07:44:44 GMT  
 Help with OutputTo SendTo Action/Method - Multi-post

Quote:
> Jeff,

> If I understand right, you may be having the same problem I had.
> Namely, I can set all the filters I want for my report when I open it
> by passing a valid Where clause in the Open event of the report.
> Displays just great in the report, but that is definitely NOT what I
> get when I e-mail it.  The e-mailed version is not filtered.

That's pretty much it. As the outputto and sendto actions/methods are
effectively self-contained, there does not appear to be anyway to
transfer and existing filtered and previewed report to the specified
command.

The concept of a holder query does sound good. I searched for your thread
but I can't find any postings from you or Lyle dating past the 12/02, so...

Quote:
> If you need the code, post back.  Lyle and I have it somewhere.

Thanks....

-----------------------------------------
Jeff Watkins
Labrug - Computer Consultant and Trainer

040809 4899



Wed, 03 Aug 2005 13:27:42 GMT  
 Help with OutputTo SendTo Action/Method - Multi-post
I'll take the code.

Quote:


> > Jeff,

> > If I understand right, you may be having the same problem I had.
> > Namely, I can set all the filters I want for my report when I open it
> > by passing a valid Where clause in the Open event of the report.
> > Displays just great in the report, but that is definitely NOT what I
> > get when I e-mail it.  The e-mailed version is not filtered.

> That's pretty much it. As the outputto and sendto actions/methods are
> effectively self-contained, there does not appear to be anyway to
> transfer and existing filtered and previewed report to the specified
> command.

> The concept of a holder query does sound good. I searched for your thread
> but I can't find any postings from you or Lyle dating past the 12/02,
so...

> > If you need the code, post back.  Lyle and I have it somewhere.

> Thanks....

> -----------------------------------------
> Jeff Watkins
> Labrug - Computer Consultant and Trainer

> 040809 4899



Wed, 03 Aug 2005 06:20:05 GMT  
 Help with OutputTo SendTo Action/Method - Multi-post
This is the link to it...

http://groups.google.com/groups?hl=en&lr=&ie=UTF8&selm=Xns92B449BFD9E...

(Watch the word wrap!)

This makes the report recordsource dynamic by changing the underlying
query's SQL. It's saving to a file, which is sent later using the
SendObject Command. There are several thousand Sends, so the Sending
is
accomplished through a form with a custom, sort of, progress bar.
qryChangeName is a Constant defined in the head of the module.

Function fCreateAccountFile(strAccountNumber As String)
    Dim qdf As QueryDef
    Dim rcs As Recordset
    Dim strFullPath As String
    Set qdf = DBEngine(0)(0).QueryDefs(qryChargesName)
    With qdf
        .SQL = "SELECT * FROM tblCharges WHERE Sent = No And Account =
" &
_
        Chr(34) & strAccountNumber & Chr(34)
        Set rcs = .OpenRecordset
        With rcs
            If .RecordCount <> 0 Then
                strFullPath = Environ("temp") & _
                "\" & "Chargeable Messages for " & strAccountNumber &
".rtf"
                DoCmd.OutputTo _
                acOutputReport, "rptCharges", acFormatRTF,
strFullPath,
False
            End If
        End With
    End With
    Set rcs = Nothing
    Set qdf = Nothing
End Function

--
Lyle



Thu, 04 Aug 2005 06:30:44 GMT  
 Help with OutputTo SendTo Action/Method - Multi-post
Looks good. I'll give it a bash.... Thanks Pieter. :-)

--
DO NOT USE REPLY
Please note that the reply address is false
in order to avoid spam mail. Please ensure that
any reply mail uses the below address.
-----------------------------------------
Jeff Watkins
Labrug - Computer Consultant and Trainer

040809 4899



Sun, 07 Aug 2005 09:16:52 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Help with outputto method

2. OutputTo Error command or action not available.

3. OutputTo Method

4. Access 97: OutputTo Method

5. Need Help with Multiple Forms / Recordset.Bookmark Method /Action Cancelled

6. Need help with POST method to an asp page

7. Help with POST method

8. POST method NOT WORKING... pls help

9. need help with VB "POST" Method

10. Errors In Multi-User Database When Performing Similar Actions

11. Post Net Bar code printing on Epson action 5000 printer

12. Getting Double POST actions

 

 
Powered by phpBB® Forum Software