Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to Word Problem

Status
Not open for further replies.

alexthomas

Technical User
Jul 22, 2004
7
US
Hi,

I have an access application with a report. I allow the user to enter some foot notes using an input box before opening the report. If the user enters some notes into the input box, it is displayed at the bottom of the access report. Since the report has summary data, I export it to Word format. Everything works fine, except the notes entered by the user. Exported Word document contains all the information from the access report except the notes. Any ideas?

I used the foll. piece of code to do the export.

DoCmd.OutputTo acOutputReport, "rptRebateOpportunityReportExtVersion", acFormatRTF, "Report.rtf", True

Thx
Alex
 
In what sense are you using the term 'Input Box'?
Do you mean using the VBA InputBox function?(you say 'before the report opens' so where is this done?)
Or are you referring to a textbox on a form? If so is the form still open when you export the report? How does the data get into the report, anyway?
 
I have the input box in the report's vba code. When I run the accees report, it is populated by a query and the summary data are calculated on the report. I close the report and then go back to the application and click the 'Export' button, which exports the data from the access report previously opened. When I click the 'Export' button, it prompts with the Input box again, since it is called within the Report_Open event.

I do the export when the report is closed. However, it exports everything - results from the query, summary data calculated on the report, page headers, footers, except the message entered through the input box.

 
Can't replicate the problem I'm afraid.
What version of Access?
I assume by 'export to word' you mean export as a .rtf file?
 
I use access 2000. I export to an rtf file. I think I cannot do it unless I pass the data to the report via db calls.
 
I've just tested my reportin A2000 and again there is no problem.

This is the code I have in the report:
(Myinput is a text box in the report header)

Option Compare Database
Option Explicit
Dim x
Private Sub Report_Open(Cancel As Integer)
x = InputBox("input data")
End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
Me!myinput = x
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top