View Full Version : Question Need help BAD!!! sOME IDEAS PLIS!1


jdcallejas
07-01-2008, 07:04 PM
Hello,

I have a dilema with reports right now... I have a form that I input a information about a person that will make a contract with me. I only fill out the necesery information on this form.

Now I have a contract where I put the inputed fields where necesary. Example:

This contract is made on this "DateField" between My Company and "PersonsName Field"

This goes on through out 6 pages. On the first page I will use most of the fields and on the last page only use his name and date for signature...

The problem is between this pages there is lots of text!!! Legal stuff...

On Reports I tried to do this but for some reason it will not let me put so much text.....

Its there anyway to do this? do you have any idea on how i might do this?

Thanks and I hope I explained good enough what i need

Pat Hartman
07-01-2008, 07:59 PM
You might consider creating a word document with bookmarks. In the Access application you would run a mail merge to supply the variables for the bookmarks. Automation is what I usually use since it is easier to control. If you can't find a useful example by searching here, post back and I'll look for one for you.

jdcallejas
07-01-2008, 08:24 PM
Thanks for the infomartion, I have looked all over the forums but could not find anything... I will look into this mail merge system, looks like it might work better that way.. Any info on where I can get info on this? Either way I will look....

Thanks

jdcallejas
07-01-2008, 09:13 PM
Hello Pat,

Found an issue with the mail merge!! it would have solved my problem but on my lease form I have a subform that I can pick multiple clients to be u nder the same contract, so with mail merge am unable to have it list all the contacts I selected on the subform but it would work great for singal name leases.... This is basicaly a Lease for apartment complexes and in one lease I could have many tenants under them...

Any other ideas that maybe we can explore?

Thanks Pat

Pat Hartman
07-01-2008, 09:15 PM
This is an example from one of my programs. Hopefully, it will give you a starting point. The application manages thousands of documents so there are tables that map the fields in a particular document to fields that hold the data that needs to be placed at the bookmark. This particular snippet, may print multiple documents hence, the outer loop.

There are several types of target fields in the Word document. So the actual Word code varies depending on whether the bookmark being filled in the Word document is a form field, check box, or plain bookmark.

Private Sub cmdViewEndorsements_Click()
On Error GoTo Err_cmdViewEndorsements_Click
Dim sDocName As String

Set db = CurrentDb()
'Fire up Word
Set WordApp = New Word.Application
WordApp.Visible = True

'Open recordset which will be used to populate bookmarks
Set qdDAO = db.QueryDefs!qEndorsementsPrint
qdDAO.Parameters![EnterVariableDataHeaderID] = Me.txtVariableDataHeaderID
qdDAO.Parameters![EnterLOA] = Me.txtLOA
Set rsDAO = qdDAO.OpenRecordset
'Loop through recordset and find endorsements
Do While rsDAO.EOF = False
sDocName = QUOTE & rsDAO!DocPath & "\" & rsDAO!AnyDocLink & QUOTE
Set WordDoc = WordApp.Documents.Add(sDocName)
'Loop through recordset and populate bookmarks
Set qdDAO2 = db.QueryDefs!qEndorsementsPrintFields
qdDAO2.Parameters![Enter VariableDataHeaderID] = Me.txtVariableDataHeaderID
qdDAO2.Parameters![Enter EndorsementID] = rsDAO!EndorsementID
Set rsDAO2 = qdDAO2.OpenRecordset
'''''Debug.Print rsDAO2!BookMarkName & " === " & rsDAO2!TextValue
Do While rsDAO2.EOF = False
If rsDAO2!ControlType = "Memo" Then
If IsNull(rsDAO2!MemoValue) Then
Else
' WordDoc.FormFields(rsDAO2!BookMarkName).result = rsDAO2!MemoValue
' WordDoc.Unprotect
WordDoc.BookMarks(rsDAO2!BookMarkName).Range.Field s(1).result.Text = rsDAO2!MemoValue
End If
Else
If IsNull(rsDAO2!TextValue) Then
Else
If rsDAO2!ControlType = "Checkbox" Then
If rsDAO2!TextValue = "Yes" Then
WordDoc.FormFields(rsDAO2!BookMarkName).CheckBox.v alue = True
Else
WordDoc.FormFields(rsDAO2!BookMarkName).CheckBox.v alue = False
End If
Else
WordDoc.FormFields(rsDAO2!BookMarkName).result = rsDAO2!TextValue
End If
End If
End If
rsDAO2.MoveNext
Loop
' fill signatures
Call AddTheSignatures
rsDAO.MoveNext
Loop

Exit_cmdViewEndorsements_Click:
Exit Sub

Err_cmdViewEndorsements_Click:
Select Case Err.Number
Case 5941, 3265
MsgBox "Bookmark - " & rsDAO2!BookMarkName & " - not found in EndorsementID = " & rsDAO!EndorsementID & " Name = " & rsDAO!DocPath & "\" & rsDAO!AnyDocLink
Resume Next
Case 5151
If Left(Right(sDocName, 10), 4) = "Manu" Then
Resume Next
Else
MsgBox "Doc Name = " & sDocName & " -- " & Err.Number & " - " & Err.Description
Resume Exit_cmdViewEndorsements_Click
End If
Case Else
MsgBox Err.Number & "-" & Err.Description
Resume Exit_cmdViewEndorsements_Click
End Select

End Sub