I am assuming you mean an "online form" created using the forms toolbar.
If this is correct, you will need an on-exit macro for your checkbox that
checks its status and if the box is checked inserts an additional field is
inserted, possibly a drop down or text field. This requires that the macro
unprotect the form, insert the field, reprotect the form without resetting
the current data, and go to the new field. I have a form that does this. You
could also use an AutoText entry in the form's template for the added field.
The form inserts fields at bookmarks and also for some macros changes the
formatting to cross out text (rather than deleting it outright). See
http://word.mvps.org/FAQs/MacrosVBA/InsertingTextAtBookmark.htm and
http://word.mvps.org/FAQs/MacrosVBA/WorkWithBookmarks.htm for details on
using bookmarks. The code for the Form is:
Option Explicit
Public sPass As String
' Module and Project Written by Charles Kyle Kenyon
' May 2001, Copyright 2001 All rights reserved
Sub DucesTecum()
'
' DucesTecum Macro
' OnExit macro for DucesTecum Checkbox
' "&chr(10)&"Macro recorded 05/16/2001 by Charles Kyle Kenyon
'
Dim strBringWith As String, rRange As Range
With ActiveDocument
UnProtectSubpoena 'subroutine below
Set rRange = .Bookmarks("YouBringYes").Range
'Save result of form field
strBringWith = .FormFields("BringWhat").Result
If .FormFields("chkDucesTecum").CheckBox.Value _
= True Then
.FormFields("DucesTecumTitle").TextInput.EditType _
Type:=wdRegularText, Default:=" Duces Tecum "
If strBringWith = "" Then strBringWith = _
"Bring what?" 'End If
.FormFields("BringWhat").TextInput.EditType _
Type:=wdRegularText, Default:=strBringWith, _
Enabled:=True
rRange.Font.DoubleStrikeThrough = False
rRange.Font.Bold = True
.FormFields("BringWhat").Select
Else
.FormFields("DucesTecumTitle").TextInput.EditType _
Type:=wdRegularText, Default:=" ", Enabled:=False
.FormFields("BringWhat").TextInput.EditType _
Type:=wdRegularText, Default:="", Enabled:=False
rRange.Font.DoubleStrikeThrough = True
rRange.Font.Bold = False
.FormFields("chkThirdParty").Select
End If
.Protect wdAllowOnlyFormFields, True, sPass
End With
End Sub
Sub ThirdParty()
'
' ThirdParty Macro
' OnExit Macro for Third-Party Checkbox
' "&chr(10)&"Macro written 05/16/2001 by Charles Kyle Kenyon
'
Dim rRange As Range
With ActiveDocument
UnProtectSubpoena 'subroutine below
Set rRange = .Bookmarks("ThirdPartyLanguage").Range
rRange.Font.DoubleStrikeThrough = _
Not .FormFields("chkThirdParty").CheckBox.Value
rRange.Font.Bold = _
.FormFields("chkThirdParty").CheckBox.Value
.Protect wdAllowOnlyFormFields, True, sPass
End With
End Sub
Private Sub UnProtectSubpoena() 'Subroutine for other procedures
With ActiveDocument
sPass = .Variables("FormPassWord")
If .ProtectionType <> wdNoProtection Then .Unprotect (sPass)
' End If
End With
End Sub
For more about online forms, follow the links at
http://addbalance.com/word/wordwebresources.htm#Forms or
http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm especially Dian
Chapman's series of articles.
If, on the other hand, you are talking about a UserForm or custom dialog
box, you probably want to post your question in the vba.userforms newsgroup.
Hope this helps,
--
Charles Kenyon
Word New User FAQ & Web Directory:
http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
http://addbalance.com/usersguide
See also the MVP FAQ:
http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.