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 2008

Tip: Looking for answers? Try searching our database.

using check box values in a formula

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paula- Horsemom - 12 Mar 2008 02:09 GMT
I have a simple word form with various formfield controls.  I want to use a
formula field that counts the number of boxes which are checked (there are
only 5).  I was thinking I could use an if  or something, but I'm not clear
on how to get the state of the check box.  I'm using the default bookmark
names (check1)

for examle If check1 is checked, then add 1 to cnt, if check2 is checked
then add 1 to cnt.  Or something liek that.

I was hoping to keep this simple and not need to write a macro.

Thanks.
Doug Robbins - Word MVP - 12 Mar 2008 03:48 GMT
You need to use the .Checkbox.Value attribute of the formfield to determine
whether or not it is checked;

Dim Counter As Long
Counter = 0
With ActiveDocument
   If .FormFields("Check1").CheckBox.Value = True Then Counter = Counter +
1
   If .FormFields("Check2").CheckBox.Value = True Then Counter = Counter +
1
   If .FormFields("Check3").CheckBox.Value = True Then Counter = Counter +
1
   If .FormFields("Check4").CheckBox.Value = True Then Counter = Counter +
1
   If .FormFields("Check5").CheckBox.Value = True Then Counter = Counter +
1
End With
MsgBox Counter

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a simple word form with various formfield controls.  I want to use a
> formula field that counts the number of boxes which are checked (there are
[quoted text clipped - 9 lines]
>
> Thanks.

Rate this thread:






 
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.