I want to create a Contract Template which will have about 3 pages of legal wording.
Then I want to insert the name, address etc of the person with who I make the contract - obviously this will be different for every contract. I will make a Combo List on a different Form to select the details of the other person.
But my question is, what is the best way to do this?
My best thought is to create a Report with a Text Box which contains all the standard wording. then insert a Text Boxes within the main Text Box where the name, address etc would go?
Personnaly I would create a template for the contract in Word or in Excel, then use Automation to create a copy of the template and insert the data from Access into it. I'm not very skilled as far as Word is concerned, but with Excel it's very easy.
I'm on several projects using the following conceptual database model. A dominant entity is the contract with its main attributes. ContractType entity is a template with its core attributes. When you select CotractTypeID offer you as a default value that is transmitted to the contract.
' This needs a reference to Excel (here for Office 2003):
' Tools --> References --> Microsoft Excel 11.0 Object Library.
Dim xlapp As Excel.Application
Set xlapp = New Excel.Application
' It's also possible to use Late Binding.
' (This does not need a reference to Excel but is less efficient).
' Dim xlApp As Object
' xlapp = CreateObject("Excel.Application")
' Useful when you're debugging.
.Visible = True
' Open the Excel file.
' Select the proper sheet.
' Select the upper-left cell (A1).
' Write something into it.
.Selection = "Something else"
' Save the file.
' Then close it.
' Close Excel. !!! This is very important !!!
' If you do not property close the instance of Excel it will remain
' locked in memory with no visible interface (only Task Manager to kill it).
' Clean up
Set xlapp = Nothing
The advantage is that an advanced user is able to modify the template(s), for instance to change the presentation of the document, without needing to modify the Access application. Moreover, Excel (or Word) has a richest set of possibilities as far as presenting a document is concerned than what you can set up in an Access report.