VB Macro Code for Checkbox - Functional Checklist Survey in Microsoft Word 2010 (part 7 of 9)
Entering the Visual Basic Macro Code for Next Checkboxes.This video shows the final end product of a Checklist Survey built in Microsoft Word 2010. Word Document is built using Visual Basic Editor and is saved as a Macro Enabled Document (.docm). VBA ActiveX Controls Used: Checkbox, Label, Commandbutton. Survey has checkbox options for a customer satisfaction survey checklist. Commandbutton allows user to clear the survey and all data is auto-calculated.
Closed Caption:
hello everyone in this next video as i
mentioned in the previous one this is
going to be lookin good continuation of
adding the check boxes of the coating
for the check boxes so you should
already have question one setup and now
we're going to set up question 2 and 3
on these i'm just going to speed up the
process and just go straight through it
just please make sure you're following
along quickly and again all of this must
be set up accurate least if not when it
comes to building the actual code to
calculate the data you will get an error
if if this is not set up properly so i'm
going to go on to get this setup here
i'm going to double-click the one and
I'm gonna do the same process that we
had for question one so i'm going to
copy the the if statement and the only
thing I'm going to do here is just
changed the 12 a to now so all we're
doing it so if question two options
click its value is true on a set q22 BCD
and es false and i'm just going to use
this code now to go forward to the next
one's option to sew it be
it's true that i'm going to set a cdna
to false
if c is true then i'm going to set a be
DNE to false for the fourth option which
is d if that value is true then i set a
b c and d to false and then now five the
number five which is optionally eq2 e is
true then we need to set a b c and d to
false and i'm going to the exact same
thing for number three
just change that information you don't
want to have the the two so if q3 a true
then set b c d and e to false
copy that if B is true then a CD and he
will be false to 3c is true then set a
BD + e2 false if Q 3d is true then set a
b c and e to false and then last if e is
true then set a b c and d to false so
all this coating is just going to make
sure that your end user can only select
one option from the checkboxes and i'm
going to just test this out
take us out of design mode put us into
production mode checkbox one that works
and i'm just going to go through them
real quick just to make sure we're set
up properly
alright we're all set you want to make
sure that you test it before you proceed
so just make sure you set up your check
box encoding correctly and then all this
does just make sure that your user can
only select one checkbox we haven't got
into the coding s2 I'm hows it how this
information will calculate so in the
next video I'm going to show how do we
can add coating on the clear survey
button that way when you select clear
survey this label gets reset and all of
your checkboxes get blacked out that way
the user can start off with the quick
with a clean survey
Video Length: 03:58
Uploaded By: Alex Cantu
View Count: 14,203