Ive got what i want to work in some fashion,im trying to build up a letter in word using bookmarks that have field values passed to them.
The values from the main form are being passed but the procedure is ignoring values from subform? code is below any ideas? (the sub form is called sub_quotations_form)
On Error GoTo grantoffer_err
'Start Microsoft Word
Dim objWord As Word.Application
Set objWord = CreateObject("Word.Application")
With objWord
' make word visible
.Visible = True
''open document hard coded path may have to be changed
.Documents.Open ("F:\HOME\cerida\DatabaseReports\GrantApplication.doc")
''move through each bookmark in form
.ActiveDocument.Bookmarks("Name").Select
.Selection.Text = (CStr(Forms!applications_staged_development!FullName))
.ActiveDocument.Bookmarks("Respondent").Select
.Selection.Text = (CStr(Forms!applications_staged_development!FullName))
.ActiveDocument.Bookmarks("Address").Select
.Selection.Text = (CStr(Forms!applications_staged_development!address))
.ActiveDocument.Bookmarks("ApplicationRef").Select
.Selection.Text = (CStr(Forms!applications_staged_development!application_ref))
.ActiveDocument.Bookmarks("CutOffDate").Select
.Selection.Text = (CStr(Forms!applications_staged_development!cut_off_date))
.ActiveDocument.Bookmarks("QuotationDescription").Select
.Selection.Text = (CStr(Forms![applications_staged_development]![sub_quotations_form].quotation_desc))
.ActiveDocument.Bookmarks("CompanyName").Select
.Selection.Text = (CStr(Forms![applications_staged_development]![sub_quotations_form].company_id))
.ActiveDocument.Bookmarks("QuotationAmount").Select
.Selection.Text = (CStr(Forms![applications_staged_development]![sub_quotations_form].quotation_amt))
End With
'' code to auto print can go in here
DoCmd.SetWarnings False
query = "UPDATE temp_applications_table SET acceptence_letter_sent = now() WHERE applications_id = " & Me.applications_id
DoCmd.RunSQL query
DoCmd.SetWarnings True
Exit Sub
grantoffer_err:
End Sub