Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

How do you make sure only one field formis allowed to be ticked??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hollabackgirl26 - 30 Mar 2007 15:08 GMT
Hi...I'm creating a form to be completed using Word, & I've entered the tick
box form fields in, but want to know how to let the person answering the
form, only tick one box out of so many boxes??

For example, one question is Male or Female....only want the person
answering to be able to tick one box!

Thanks very much for your help in advance!
Jay Freedman - 30 Mar 2007 15:40 GMT
You could use the macro solution at
http://www.word.mvps.org/FAQs/TblsFldsFms/ExclusiveFmFldChbxs.htm.

However, I think a dropdown form field would be a better solution, even if
it only has two items in it. Then you don't have to worry about whether the
user has disabled macros.

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> Hi...I'm creating a form to be completed using Word, & I've entered
> the tick box form fields in, but want to know how to let the person
[quoted text clipped - 4 lines]
>
> Thanks very much for your help in advance!
hollabackgirl26 - 30 Mar 2007 16:10 GMT
Thanks for that!!!!  Now I've got a new question....how do I record a macro
for my form??  I'm not too computer illiterate....but everything I'm tryin is
not likin it!!

Do you hve to record the macro at the bottom of the form in the same
document?  How do you get to enter the code??

Sorry & thank you!!!

> You could use the macro solution at
> http://www.word.mvps.org/FAQs/TblsFldsFms/ExclusiveFmFldChbxs.htm.
[quoted text clipped - 11 lines]
> >
> > Thanks very much for your help in advance!
Jay Freedman - 30 Mar 2007 17:24 GMT
You can't record that macro; you copy it from the web page and paste it into
the VBA editor. Read the instructions at
http://www.gmayor.com/installing_macro.htm.

Also note that this stuff needs to be in a _template_ (*.dot file), not in a
_document_ (*.doc file) because macros in documents always run into the
macro security roadblock -- Word thinks that any document containing a macro
is likely to be a virus.

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> Thanks for that!!!!  Now I've got a new question....how do I record a
> macro for my form??  I'm not too computer illiterate....but
[quoted text clipped - 27 lines]
>>>
>>> Thanks very much for your help in advance!
Rob - 30 Mar 2007 16:12 GMT
If you do it this way instead it will work like a toggle with the mouse, tab
or arrow keys.

Name one checkbox "chkMale", and put this sub as the entry AND exit macro:

Sub CheckMale()
   If ActiveDocument.FormFields("chkMale").CheckBox.Value = True Then
       ActiveDocument.FormFields("chkFemale").CheckBox.Value = False
   End If
End Sub

Name the other checkbox "chkFemale" and put this sub as both the entry AND
exit macro:

Sub CheckFemale()
   If ActiveDocument.FormFields("chkFemale").CheckBox.Value = True Then
       ActiveDocument.FormFields("chkMale").CheckBox.Value = False
   End If
End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.