This code outputs a report to an rtf file:
VB Code:
  1. Set dbs = CurrentDb
  2. Set qdf = dbs.QueryDefs("qryrptScheduleA")
  3. qdf.sql = "Select * from vwScheduleA " & strWhere
  4. DoCmd.OutputTo acOutputReport, "rptScheduleArtf", acFormatRTF, "H:\ProviderPDF\in\file.rtf"
I need to create multiple rtf files after grouping by an item in vwScheduleA. Not sure how create a variable in strWhere to loop through the report and return 1 record at a time. The filename (file.rtf) will become a variable.

desired output:
item1.rtf
item2.rtf
item3.rtf

I greatly appreciate suggestions!