?
Solved

Word 2010 - checkboxes with automatic autofil

Posted on 2013-06-24
1
Medium Priority
?
557 Views
Last Modified: 2013-06-24
Hello All:

I'm creating an Word Document and have 7 separate tables ( 1 table attached for reference ).  I am using 'autofield' for the auto fill so after the separate 7 tables ; It would autosum to equal on an separate table.  

My problem is I have checkboxes that when checked, need to update the 'autofield' with the appropriate number. I've used multiple macros & nothing worked so I've deleted all macros and starting fresh so any help would be greatly appreciated.  

I've also attached 2 examples.
attachment.png = Orange circle is autofield needed for autosum
example1.png = Checked 5 and autofilled #5
example2.png = Checked 3 and autofilled #3
attachment.PNG
example1.PNG
example2.PNG
0
Comment
Question by:synertia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 39271371
It is difficult to be sure from your description and just pictures, but I am guessing that you are using form fields.

If you change the bookmark names of the fields to something like quantity_5, quantity_4 etc., you can use a macro like this and set it to be the exit macro for each of the checkboxes.
Sub FillField()
Dim ffldCheck As FormField
Dim ffldText As FormField
Dim strName  As String
Dim strNumber As String

Set ffldCheck = Selection.FormFields(1)
strName = Split(ffld1.Name, "_")(0)
strNumber = Split(ffld1.Name, "_")(1)

Set ffldText = ActiveDocument.FormFields(strName)

If ffldCheck.CheckBox.Value = True Then
    ffldText.Result = strNumber
Else
    ffldText.Result = ""
End If

End Sub

Open in new window

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Suggested Courses
Course of the Month8 days, 14 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question