Unanswered: embed word doc in access report, show diff doc on each page of report
I am trying to embed/link? a word document in an Access 2000 report. The report prints a different access record on each page and each rep pg/access record has an associated word doc which needs to be printed on that page (need word doc for Word's formatting capabilities), followed by a small subreport lsiting associated records from the database. My problem is, how do i change (using vba in the on format code for the section containing the embedded word doc presumably) the name of the word document which is displayed for each access record. I have found code to do this on a form, but it requires the enabled and locked properties for the ole object to be altered to work, and those properties are not available in a report.
Any ideas would be most helpful? (Other than reversing the process and using mail merge and drving it from Word which i want to avoid if possible.)
Thanks for the reply, but I have no problem obtaining the word doc name. My problem is, what code do I need to change the source for the document in the report TO that document name, and have the right doc print out. Its not a form Im displaying the doc on, its a report, and the only code Ive found so far is for forms, and relies on the control's enabled and locked properties being set, which of course dont exist in a report.
I may be misinterpreting what youre saying , could you let me know if you think I am.
Thnaks a lot for the offer. Ill zip up a small mdb with a report with embedded doc, and 2 docs, and table with the doc name and path in a field, and two records in the table. I have tried chging the doc source in the on format for the section where it is embedded but cant get the code to work. I get an error of some sort whatever Ive tried so far.
Emaill with zip attchment to follow soon. Thanks very much for your help.
Thanks for the help, zip file with small testdb (1 table containing 3 records, and 1 report), and three word docs attached one for each record in table. Table has fields for path and file name for the word doc for each record.
If you can help thatd be great as I'm stuck at the moment.
When I run the report with my code to chg the docsource for the ole object to the path and filename required (in the on format event for that section) I get an error and i have tried a whole lot of different versions of coding it and all either do nothing or cause a runtime error.