Well after playing around with my code and doing more research i finally got it to work as wanted it to, here's the final product, maybe it can be of use to someone else in the future
Code:
Dim Tax1 As Single
Dim Tax2 As Single
Tax1 = 0.09
Tax2 = 0.08
If ActiveDocument.FormFields("QSTCHECK").CheckBox.Value = True Then
ActiveDocument.FormFields("RECTAX").Result = Tax1 * ActiveDocument.FormFields("RECURRENTSDB").Result
I've tried the code string suggested but it give me a compiling error and refuses to work :/
Shouldn't my "final" and "checkbox" form field name be referenced somewhere in that code for the program to pick up where it need to put the answer?
Not to forget that code is linked up to a word document, there may be restrictive limits that VB wouldn't have it was operating on it own to create that program
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.
Leave a comment: