Exporting RTF with FilterOn

cstahlberg

New member
Local time
Today, 18:50
Joined
Aug 31, 2004
Messages
9
I have an application which creates reports with upwards of 500 single record pages. I want to have a menu option to export only the page being displyed to a .rtf (as opposed to all 500 pages). My current thinking is to set a filter, run the DoCmd.OutputTo and then remove the filter. The problem is that I can't get the filter to reflect the data actually showing in the form.

Currently my code looks like:

lname = Reports(Application.CurrentObjectName).Last_Name
SSN = Reports(Application.CurrentObjectName).SSN
Reports(Application.CurrentObjectName).filter = _
"[Last Name] = " & """" & lname & """" & " and [SSN] = " & """" & SSN & """"
Reports(Application.CurrentObjectName).FilterOn = True
DoCmd.OutputTo acOutputReport, , acFormatRTF, , True
Reports(Application.CurrentObjectName).FilterOn = False

Here I create a filter based on the fields [Last Name] and [SSN] and then export. Filter ends up as the record after the last page viewed as opposed to the page which is currently being viewed. Any ideas would be greatly appreciated.

-Cyrus
 

Users who are viewing this thread

Back
Top Bottom