Should I declare a temporary listbox to carry over the values to the next listbox?
My listbox is named IRABene_Main.ListBox1 in both documents and I can't seem to find a way to write doc.IRABene_Main.ListBox1and mean to update the blank form's listbox.
See the following code:
Expand|Select|Wrap|Line Numbers
- Private Sub UpdateAdditionalAccount_Click()
- Dim appWord As Word.Application
- Dim doc As Word.Document
- Dim Name As String
- Dim SSN As String
- Dim bday As String
- Dim address As String
- Dim dayphone As String
- Dim branch As String
- Name = Me.FormFields("name1").Result
- SSN = Me.FormFields("ssn").Result
- bday = Me.FormFields("bday").Result
- address = Me.FormFields("address").Result
- dayphone = Me.FormFields("dayphone").Result
- branch = Me.FormFields("branch").Result
- Set appWord = CreateObject("Word.Application")
- appWord.Visible = True
- Set doc = appWord.Documents.Add(Template:="S......Y.docm", NewTemplate:=False, DocumentType:=0)
- doc.FormFields("name1").Result = Name
- doc.FormFields("ssn").Result = SSN
- doc.FormFields("bday").Result = bday
- doc.FormFields("address").Result = address
- doc.FormFields("dayphone").Result = dayphone
- doc.FormFields("branch").Result = branch
- End Sub