fredg said:
I don't know what you mean by "a connection to the right record in the
Db".
Thanks a lot for Your assistanse so far.
I have done all of the below but then the same appendix text appears on
every
Offer they print. That´s what I mean by "a connection to the record in the
Db". Diffrent offers have diffrent appendix so I need to have a way for the
users to
create a word document and link that document to a specific OfferID in the
database.
I guess that involves adding a field in the DB and some sort of control in
the form
where the offers are created. That control would contain a word object.
I hope You understand what I mean. Can it be done?
You can create a one page Word document.
Then in your report, add an OLEUnbound control to the Report Footer.
When adding it select Link.
Size it to the full length and width of the paper you are using.
(minus the margins).
Set the Report's PageFooter property to Not with RptFtr.
It's on the Form property sheet's Format tab.
Set the Report Footer's ForceNewPage property to BeforeSection.
That's on the Report Footer property sheet's Format tab.
Edit the Word document as needed (using Word).
Any changes will automatically be reflected in the Access report.
Print the Access report. The Word document will print as the Report
Footer. The Page Footer will not appear on this page.
You can also use some criteria to not print the Word document by
coding the ReportFooter Format event:
Cancel = [SomeControl] = SomeValue
It will just throw out a blank page.
OK. If you only have a few different Appendix reports, here is how I
managed it.
Let's assume just as an example, you have a field in your report you
use to determine which document you wish to append.
We'll use your [OrderID].
And, we'll assume there is just one OrderID per report.
So if the Order ID in the report is 12345 we'll print word doc A.
If the Order ID is 98765 we'll print word doc B.
If its 55555 we'll print word doc C, etc.
If not a listed OrderID we'll not print anything (as an appendix).
1) Create the different word documents, A, B, and C.
2) Add an OLEUnbound control to the Report Footer for 'each' word doc.
In this case we'll add 3. One for DocA. One for DocB, one for DocC,
linked to their respective documents.
Set their SizeMode to Zoom.
Set their Visible property to No.
Size the controls to the same width and height, left and top, so they
overlap one another.
Code the Report Footer Format event:
If [OrderID] = 12345 then
Me.OLEUnbound1.Visible = True
Me.OLEUnbound2.Visible = False
Me.OLEUnbound3.Visible = False
ElseIf [OrderID] - 98765 Then
Me.OLEUnbound1.Visible = False
Me.OLEUnbound2.Visible = True
Me.OLEUnbound3.Visible = False
ElseIf [OrderID] = 55555 Then
Me.OLEUnbound3.Visible = True
Me.OLEUnbound1.Visible = False
Me.OLEUnbound2.Visible = False
Else
' Don't show any appendix. A blank page will go through the printer.
Cancel = True
End If
Change the Word doc names and the control and field names as needed.
To edit the documents, double click on the linked OLE control for that
document.
Make and save your changes.
The above seemed to work well for me.