469,964 Members | 1,474 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

Email filtered report

Dear All,

SendObject has no where-argument!

How can i email a report having user-defined filter, without opening the
report?

On a unbound form the user can set the criteria for a report.
The where-argument is set depending the user choice.
He can output the report as preview, print or email.
Opening the report as preview or print has a where-argument but sendobject
doesn't !

Thanks,

Filip
Nov 13 '05 #1
2 4121
1. On the Modules tab of the Database window, click New.
At the top of the module (with the Option statements), enter:
Dim gstrReportFilter As String.

2. In the Open event procedure of your report, put this code:
Private Sub Report_Open(Cancel As Integer)
If Len(gstrReportFilter) > 0 Then
Me.Filter = gstrReportFilter
Me.FilterOn = True
gstrReportFilter = vbNullString
End If
End Sub

3. When you call the report, set the filter string before you call
SendObject or OutputTo or whatever.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Filips Benoit" <be***********@pandora.be> wrote in message
news:fy*********************@phobos.telenet-ops.be...
Dear All,

SendObject has no where-argument!

How can i email a report having user-defined filter, without opening the
report?

On a unbound form the user can set the criteria for a report.
The where-argument is set depending the user choice.
He can output the report as preview, print or email.
Opening the report as preview or print has a where-argument but sendobject
doesn't !

Thanks,

Filip

Nov 13 '05 #2
Thanks,

I should have found this myself, but I didn't !

Filip

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41**********************@per-qv1-newsreader-01.iinet.net.au...
1. On the Modules tab of the Database window, click New.
At the top of the module (with the Option statements), enter:
Dim gstrReportFilter As String.

2. In the Open event procedure of your report, put this code:
Private Sub Report_Open(Cancel As Integer)
If Len(gstrReportFilter) > 0 Then
Me.Filter = gstrReportFilter
Me.FilterOn = True
gstrReportFilter = vbNullString
End If
End Sub

3. When you call the report, set the filter string before you call
SendObject or OutputTo or whatever.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Filips Benoit" <be***********@pandora.be> wrote in message
news:fy*********************@phobos.telenet-ops.be...
Dear All,

SendObject has no where-argument!

How can i email a report having user-defined filter, without opening the
report?

On a unbound form the user can set the criteria for a report.
The where-argument is set depending the user choice.
He can output the report as preview, print or email.
Opening the report as preview or print has a where-argument but sendobject doesn't !

Thanks,

Filip


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by S.Dickson | last post: by
2 posts views Thread by John Taylor | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.