I am trying to write the VBA for 2 forms where the information on Form2 is dependant on what was selected in Form1.
Here is the wording for what I need and a sample of the code I have below:
If I have chosen OptionButton1 on Form1 and I choose OptionButton2 on Form2 then this happens. Code:
If OptionButton2 = True Then
If Forms.Document.OptionButton1 = True Then
ActiveDocument.AttachedTemplate.AutoTextEntries( _
"XXXX").Insert Where:=Selection.Range
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End If
If Forms.Document.OptionButton2 = True Then
ActiveDocument.AttachedTemplate.AutoTextEntries( _
"XXXX").Insert Where:=Selection.Range
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End If
End If
What am I doing wrong?
|