Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jul 2004
    Location
    Hertfordshire, England
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to trigger a macro on a calcuated form field (2002 SP-3 on XP)

    I have a purchase order document with form fields (not ActiveX) to calculate quantity x unit price to get an extended price. The extended price field has "calculate on exit" selected. There is a calculated form field at the bottom called Total that sums all the extended prices above it. If the TotalPrice is >100, then I want to change a checkbox value to true. Here's the code for the macro:

    If ActiveDocument.FormFields("TotalPrice").Result > "100.00" Then
    ActiveDocument.FormFields("Finance").CheckBox.Valu e = True
    Else
    ActiveDocument.FormFields("Finance").CheckBox.Valu e = False
    End If

    I've tried calling the macro from the OnEntry and OnExit events in every conceivable field, but it just won't trigger. I really need help quickly, if anyone has suggestions.

    Thank you.

  2. #2
    New Lounger
    Join Date
    Jul 2004
    Location
    Hertfordshire, England
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to trigger a macro on a calcuated form field (2002 SP-3 on XP)

    Thank you, Hans.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to trigger a macro on a calcuated form field (2002 SP-3 on XP)

    The On Exit event of a calculated form field never occurs. Instead, you must set the On Exit macro of each contributing text form field (quantity and unit price), so that the check box get updated when the user tabs out of one of those.

Posting Permissions

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