Consulting

Results 1 to 4 of 4

Thread: Help: Word form checkbox refuses to execute macro

  1. #1

    Help: Word form checkbox refuses to execute macro

    I created a formfield checkbox and set it to execute a simple macro that will pop up a msg box.

    I set the options execute macro on exit and played with the setting calculate on exit.

    However, I can not get word to execute the macro no matter what. I have disabled all macro security and everything.

    Does anyone have any clues why it would not work?

  2. #2
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Does anyone have any clues why it would not work?
    Maybe, if you move a little to the left so I can see what you are doing, on your screen.....

    Clues as to why "it" - the unknown code - "would not work".

    Sure:

    1. The code does not actually do anything.

    2. The code tries to do something that can not be done.

    3. The code uses variables that are not in scope.
    3 (b) you are not using Option Explicit

    4. The code does not execute because there is no exit being done. This not likely.

    5. The code tries to put something value in the message box that is using invalid syntax - version of 3(b).

    How do you know it is not working?

  3. #3
    I figured this one out. If I only make 1 check box, it will not execute my code when I click on it.

    If i make 2 checkboxes and change focus onto second checkbox, the code for the first checkbox will execute.

    My code btw is

    MsgBox "test"

  4. #4
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    If I only make 1 check box, it will not execute my code when I click on it.

    If i make 2 checkboxes and change focus onto second checkbox, the code for the first checkbox will execute.
    That is because it is an OnExit macro. That is..."change focus".

    BTW: there is no OnClick event. So clicking on the checkbox will not fire anything. There IS an OnEntry macro.

    If you use ActiveX checkboxes, then you can have a Click event.

Posting Permissions

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