Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Aug 2001
    Anaheim, California, USA
    Thanked 2 Times in 2 Posts

    Use If to test a check box (2003/SR2)

    I am using Form Fields on a template to create a PO. I am doing all of the math within Word, no excel tables. I put in a check box that should be checked if an item is taxable. I am then using a Text Form Field with the Calculation Type. The expression that I am using is =if(d2="true",e2*.0825,0) I can't seem to find the right format for the d2= ____ . I have tried True False, On, Off, all in quotes and not, and 0 & -1. None of them seem to work. What is the correct syntax for this? Thanks for your help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Use If to test a check box (2003/SR2)

    I don't think you can refer to the value of a form check box in expressions. You'll probably have to use a macro that is run when each of the form fields that contribute to the result is exited, and set the result explicitly. For example:

    Sub MyExit()
    If ActiveDocument.FormFields("Check1").CheckBox.Value = True Then
    ActiveDocument.FormFields("Text2").Result = _
    0.0825 * ActiveDocument.FormFields("Text3").Result
    ActiveDocument.FormFields("Text2").Result = 0
    End If
    End Sub

    Set this as the On Exit macro for (in this example) Check1 and Text2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts