Hi, First time to these forums
I hope this makes some sense!
I am using .FormFields to fill a quotation template in Word, but the subform I am retrieving the data from has rows of records under each column and I need to send more than just the first row to fill the required bookmarks in Word.
The code i'm using is
Many thanks.
I hope this makes some sense!
I am using .FormFields to fill a quotation template in Word, but the subform I am retrieving the data from has rows of records under each column and I need to send more than just the first row to fill the required bookmarks in Word.
The code i'm using is
Code:
Set doc = appWord.Documents.Open("S:\Templates\Quotation Template - Test.doc", , True)
With doc
.FormFields("FirstName").Result = Me!FirstName
.FormFields("FirstName2").Result = Me!FirstName
.FormFields("LastName").Result = Me!LastName
.FormFields("LastName2").Result = Me!LastName
.FormFields("CompanyName").Result = Me!CompanyName
.FormFields("CompanyName2").Result = Me!CompanyName
.FormFields("Address1").Result = Me!Address1
.FormFields("Address1_2").Result = Me!Address1
.FormFields("Address2").Result = Me!Address2
.FormFields("Address2_2").Result = Me!Address2
.FormFields("Address3").Result = Me!Address3
.FormFields("Address3_2").Result = Me!Address3
.FormFields("fldRegion").Result = Me!Region
.FormFields("PostalCode").Result = Me!PostalCode
.FormFields("PostalCode2").Result = Me!PostalCode
.FormFields("emailname").Result = Me!EmailName
.FormFields("emailname2").Result = Me!EmailName
.FormFields("QuoteReference").Result = Me!QuoteReference
.FormFields("QuoteReference2").Result = Me!QuoteReference
.FormFields("QuoteProjectName").Result = Me!QuoteProjectName
.FormFields("QuoteProjectName2").Result = Me!QuoteProjectName
.FormFields("QuoteDate").Result = Me!QuoteDate
.FormFields("QuoteDate2").Result = Me!QuoteDate
.FormFields("txtVatValue").Result = Me!txtVatValue
.FormFields("txtTotal").Result = Me!txtTotal
.FormFields("txtSubTotal").Result = Me!txtSubTotal
.FormFields("cmbStaff").Result = Me!cmbStaff
.FormFields("ProductID").Result = Me.[frmQuotesSub].Form.[ProductID]
.FormFields("Qty").Result = Me.[frmQuotesSub].Form.[Qty]
.FormFields("UnitPrice").Result = Me.[frmQuotesSub].Form.[UnitPrice]
.FormFields("ExtendedPrice").Result = Me.[frmQuotesSub].Form.[ExtendedPrice]
Many thanks.