export MS Access report to MS Word on separate pages

  • Thread starter Thread starter Beonita Holland
  • Start date Start date
B

Beonita Holland

I have reports that I run for my department. The reports are separated based on the user name. I need the report to export to separate word documents making it easier send to the respective user. There has to be some way of exporting reports from Access to word on multiple documents so that I can send each user their specific page. Currently I have been manually exporting to word then cut an paste into separate word documents. For example, if my report is 6 pages I need it to export to 6 word documents (.rtf).

Also, since I am on company computers i am not able to download any of the software i've come across in my search for a fix for this issue. I would like to be able to add this function to my macro to have the entire process automated.

Anyone have a simple fix for me? Programming is new to me, still learning :).

thanks
Beonita

EggHeadCafe - Software Developer Portal of Choice
Keep ViewState out of Page for Performance Enhancement Redux
http://www.eggheadcafe.com/tutorial...8-64dd33bfc2fe/keep-viewstate-out-of-pag.aspx
 
Beonita,

Here you go... One for if your combo box is numeric, the other if it is
text. Change information to your report, drive and folder names.


'Posted by ADezii 5.23.2009 on bytes.com
'Modified by Gina Whipp 11.4.2009 to OutputTo Multiple Files
'Tested in Access 2003

Dim intCounter As Integer
Dim cboCode As ComboBox

Set cboCode = Me![YourControl]

'If Your Data Type is Numeric
For intCounter = 0 To cboCode.ListCount - 1
DoCmd.OpenReport "YourReport", acViewPreview, , _
"[YourFieldControlSource] = " &
cboCode.ItemData(intCounter)
DoEvents
DoCmd.OutputTo acReport, "YourReport", acFormatRTF,
"DriveLetter:\FolderName\FileName" & Format(intCounter, "000") & ".rtf"
DoCmd.Close acReport, "YourReport"
Next

'If Your Data Type is a String
For intCounter = 0 To cboCode.ListCount - 1
DoCmd.OpenReport "YourReport", acViewPreview, , _
"[YourFieldControlSource] = '" &
cboCode.ItemData(intCounter) & "'"
DoEvents
DoCmd.OutputTo acReport, "YourReport", acFormatRTF,
"DriveLetter:\FolderName\FileName" & Format(intCounter, "000") & ".rtf"
DoCmd.Close acReport, "YourReport"
Next

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
Back
Top