473,394 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Opening an Access report in Word

114 100+
Wondering if somone knows how to open a Access report in Word or export it to Word. Currently I'm opening and printing a report using VBA with the following command (DoCmd.OpenReport "TheReportName", , , strWhere) and strWhere is a variable containg a list of key's for the report to print from a table.

Is this possable to do?

The reason for this is the person printing the report would like to do some editing of a memo field before printing, and saving the changes as a word.doc only if changes where made. Else just print and exit Word is all that would be required. The Access table with the record that contains the memo field is a history table, read only and no changes are allowed to this table.
Dec 27 '06 #1
8 14396
willakawill
1,646 1GB
Wondering if somone knows how to open a Access report in Word or export it to Word. Currently I'm opening and printing a report using VBA with the following command (DoCmd.OpenReport "TheReportName", , , strWhere) and strWhere is a variable containg a list of key's for the report to print from a table.

Is this possable to do?

The reason for this is the person printing the report would like to do some editing of a memo field before printing, and saving the changes as a word.doc only if changes where made. Else just print and exit Word is all that would be required. The Access table with the record that contains the memo field is a history table, read only and no changes are allowed to this table.
Hi. I don't think you can export to word. You could use automation to recreate the report in Word. Could get messy though.
Dec 28 '06 #2
Killer42
8,435 Expert 8TB
Hi. I don't think you can export to word. You could use automation to recreate the report in Word. Could get messy though.
I notice there's an option in the Tools menu (Access 2000) to "Publish It with MS Word" - could this be any help? Is there a corresponding export function?
Dec 28 '06 #3
willakawill
1,646 1GB
I notice there's an option in the Tools menu (Access 2000) to "Publish It with MS Word" - could this be any help? Is there a corresponding export function?
This will publish records in a word table, not transfer a report
Dec 28 '06 #4
Killer42
8,435 Expert 8TB
This will publish records in a word table, not transfer a report
Admittedly I've never used the "Office Links" before, but I just tried this one on a report, and it seems to have reproduced the same report in Word (same as what I saw in Preview, anyway), though it did lose the borders around things.

And there is no table in the word document - just formatted text.

I don't know exactly how well it worked, though, as this was a very simple tabular or columnar autoreport.

I'm still wondering, though, about the possibility of exporting as RTF.
Dec 28 '06 #5
willakawill
1,646 1GB
Admittedly I've never used the "Office Links" before, but I just tried this one on a report, and it seems to have reproduced the same report in Word (same as what I saw in Preview, anyway), though it did lose the borders around things.

And there is no table in the word document - just formatted text.

I don't know exactly how well it worked, though, as this was a very simple tabular or columnar autoreport.

I'm still wondering, though, about the possibility of exporting as RTF.
You're right. It almost works out. This would satisfy the above question I'm sure.
Dec 28 '06 #6
ljungers
114 100+
Thanks to all of you that replied. I did give both ways a try and found that the links via tools>Office Links>MS Word fills the requirements in a round about way and it created a RTF document.

The problem is that the report is tied to the primary key "rec_no" for this table but in normal use the user clicks a "Print Selected" button that uses a selected "rec_no" and only printing desired report(s).

So in my case I get all 29230 records placed in an rtf document and then Word goes through a 7-10 minute conversion before opening in word.

What I would like to do is perform this process in VBA if that's possible so that the user only has to click either the "Print Selected" or "Send to Word" buttons.

The more I think about this the more I realize that this process could be used for several requirements that I have been asked for. Thanks again for the replies.
Dec 28 '06 #7
ADezii
8,834 Expert 8TB
Admittedly I've never used the "Office Links" before, but I just tried this one on a report, and it seems to have reproduced the same report in Word (same as what I saw in Preview, anyway), though it did lose the borders around things.

And there is no table in the word document - just formatted text.

I don't know exactly how well it worked, though, as this was a very simple tabular or columnar autoreport.

I'm still wondering, though, about the possibility of exporting as RTF.
'The following code will Export rptEmployee to Employee.rtf and automatically
'load it in the Server Application, in this case Microsoft Word:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acOutputReport, "rptEmployee", acFormatRTF, "Employee.rtf", True
Dec 28 '06 #8
ljungers
114 100+
'The following code will Export rptEmployee to Employee.rtf and automatically
'load it in the Server Application, in this case Microsoft Word:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acOutputReport, "rptEmployee", acFormatRTF, "Employee.rtf", True
Did give it a try changing the rptEmployee to the report name that I want to send to Word. Definitely got the report in word for the complete table that the report uses.

I do have a command button that runs a VBA script that runs the report I desire to export/open with only selected records from that table printing. Here is the code:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "Memo141Report", , , strWhere
the strWhere is a string of PK's that the report uses to print from table.

Is there a way to do the same with the OutputTo command so that I only get what was desired instead of the complete table.
Dec 28 '06 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
1
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
2
by: amith.srinivas | last post by:
Hi all, From a word macro in VBA, I am trying to create a report in access DB. The report is based on a query with a parameter. I am using Set rpt = Application.CreateReport rpt.RecordSource =...
5
by: rick m | last post by:
We have a fairly good sized Access database that contains some info on the children our agency sees. We also have 40+ templates that require some info from the database be inputted into them, such...
2
by: rmfoley | last post by:
All, I would like to create a professional looking cover sheet with information loaded from an MS Access Report. I created the cover sheet in MS Word that includes my company logo, etc. My...
8
by: babyangel43 | last post by:
Hello, I have a query set up in Access. I run it monthly, changing "date of test". I would like this query to be merged with a Word document so that the cover letter is created in Word, the fields...
5
by: Debbiedo | last post by:
I am wondering if I can create an application that when you click on it (say a shortcut), it opens a report parameter box to query a set of parameters, and then opens the report based on these...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.