M
Mark
I am using Word 2003.
I have a document with formfields throughout the but because of the number
of options in some of the dropdowns I have had to call a form to populate
some of the fields(which are repeated several times throughout the document).
The following code identifies the field and is supposed to poplulate that
particular field, but it doesn't always work and populates a totally
different field at the begining of the document!
Private Sub ComboBox1_Change()
Dim sDivision As String
If Selection.FormFields.Count = 1 Then
'No textbox but a check- or listbox
'MsgBox Selection.FormFields(1).Name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count > 0 Then
sDivision = Selection.Bookmarks(Selection.Bookmarks.Count).Name
End If
ActiveDocument.FormFields(sDivision).Result = ComboBox1.Value
Unload Me
ActiveDocument.FormFields(sDivision).Next.Select
End Sub
Can anyone assistme with a solution, please?
Thanks in advance.
I have a document with formfields throughout the but because of the number
of options in some of the dropdowns I have had to call a form to populate
some of the fields(which are repeated several times throughout the document).
The following code identifies the field and is supposed to poplulate that
particular field, but it doesn't always work and populates a totally
different field at the begining of the document!
Private Sub ComboBox1_Change()
Dim sDivision As String
If Selection.FormFields.Count = 1 Then
'No textbox but a check- or listbox
'MsgBox Selection.FormFields(1).Name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count > 0 Then
sDivision = Selection.Bookmarks(Selection.Bookmarks.Count).Name
End If
ActiveDocument.FormFields(sDivision).Result = ComboBox1.Value
Unload Me
ActiveDocument.FormFields(sDivision).Next.Select
End Sub
Can anyone assistme with a solution, please?
Thanks in advance.