Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-30-2016, 05:15 PM
Guessed's Avatar
Guessed Guessed is offline Using check boxes and moving to start of document Windows 10 Using check boxes and moving to start of document Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,158
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I would be trying to design a way of tagging each checkbox with the expected value. For instance, the macro loops across all the checkboxes to check if, in each case, the value matches the tag.
I think the only way to tag a legacy form checkbox is to use its bookmark value. For instance, you could set the bookmark values of Q1a0, Q1b0, Q1c1, Q1d0 such that the last character tells you which one(s) need to be true. Then the loop can compare the checkbox values to this information and arrive at the correct/incorrect decision. For example the following code
Code:
Sub CheckCbs()
  Dim aFF As FormField, bAnswer As Boolean
  bAnswer = True
  For Each aFF In ActiveDocument.FormFields
    Debug.Print aFF.Range.Bookmarks(1).Name, Right(aFF.Range.Bookmarks(1).Name, 1) = aFF.CheckBox.Value
    bAnswer = bAnswer And Right(aFF.Range.Bookmarks(1).Name, 1) = aFF.CheckBox.Value
  Next aFF
  MsgBox bAnswer
End Sub
If you put each set of check boxes into their own table cell then you could adjust the macro to interrogate only the current cell range which would enable every checkbox macro to use the same code each time.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro (or something) to run Spell Check within rich text content boxes in lock document NMBELL Word 8 12-21-2015 04:09 PM
Word2010 check boxes and plain text content control boxes in same table fcsungard Word 5 06-01-2012 01:16 AM
Using check boxes and moving to start of document Check boxes display funkyspirit Word 3 05-23-2012 08:39 AM
Using check boxes and moving to start of document Check Boxes jellyrolls Office 4 07-15-2011 08:07 PM
Problem with Developer Form -- Check Boxes and Text Boxes PCC Word 1 05-16-2009 05:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:45 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft