Here what I'm trying to make work, I'm using a Word document with several form fields.
I created three fields, a checkbox called "checkbox", and two number fields called "initial" and "final". The user will enter a number in "initial". If they check checkbox", then "final" should be 9% of "initial", otherwise it should equal to 0.
Now, what i have seen, because of the checkbox, there seem to no way to use a equation that would make this work within the formfield, at least none that i have tried so far. I read on a forum elsewhere that a macro could be ran to get the desired effect but my knowledge in VB isn't great.
After a few attempts i got something to work on recognizing the box being checked or not, but i can't get the value in "final" to show the 9% that i want. All i keep getting is for it to 6.30 regardless of what i put in my "initial" field.
Here's what i have so far
It's probably something simple to crack but i don't know where to go next
I created three fields, a checkbox called "checkbox", and two number fields called "initial" and "final". The user will enter a number in "initial". If they check checkbox", then "final" should be 9% of "initial", otherwise it should equal to 0.
Now, what i have seen, because of the checkbox, there seem to no way to use a equation that would make this work within the formfield, at least none that i have tried so far. I read on a forum elsewhere that a macro could be ran to get the desired effect but my knowledge in VB isn't great.
After a few attempts i got something to work on recognizing the box being checked or not, but i can't get the value in "final" to show the 9% that i want. All i keep getting is for it to 6.30 regardless of what i put in my "initial" field.
Here's what i have so far
Code:
Dim Tax As Double
Tax = 0.09
If ActiveDocument.FormFields("CHECKBOX").CheckBox.Value = True Then
ActiveDocument.FormFields("final").Result = ActiveDocument.FormFields("initial") * Tax
Else
ActiveDocument.FormFields("final").Result = 0
End If
End Sub
Comment