Applying a filter to an exported report

fearless

New member
Local time
Tomorrow, 08:38
Joined
May 2, 2005
Messages
8
All

I have a form where the user can select which report to run. When the user clicks a command button the selected report is exported in RTF format. Other buttons allow preview or printing

Code for the export to Word (RTF) follows.

Private Sub cmbTo_Word_Click()
Dim stDocName As String

If IsNull(Me!cmbRptShortDesc) Then
MsgBox "You must choose a report", vbExclamation
Else
stDocName = Me!cmbRptShortDesc.Column(1)
DoCmd.OutputTo acReport, stDocName, acFormatRTF, _
"c:\Temp\" & stDocName & ".rtf", True
End Sub

This works but the user now wants to create a seperate file for each company in the report. They do not want to select each company from a list or combo box. The process should be automatic. Click button write one file per company.

I am thinking I would put a loop arround the OutputTo statement but am stumped about how to apply a different filter to the report on each loop. Can you make a suggestion.

Thanks for your help
Fearless
 

Users who are viewing this thread

Back
Top Bottom