Sathish
Sathish

Reputation: 25

Not a sub or function name error

I have added a new function called "ClearItem" in "common" script library. I want to call this function in a form called "Welcome". In "Welcome" form, i added the script library "common" in global and clicked save button. After saving the form, i tried to call the "ClearItem" function in one of the button action in "Welcome" form. It always throw an error as "Not a sub or function name : CLEARITEM", I don't know why.

Note - ClearItem function is present in common script library.

Appreciate if anyone could help me on this.

Upvotes: 0

Views: 1552

Answers (1)

Tode
Tode

Reputation: 12060

There are two (Options)- sections in a form to add a script- library.

One is in the (Globals)FormName section, the other one in the FormName section of the designer.

If you add the library to the latter, it cannot be found. It has to be in the former to be accessible from Buttons.

If you just need the library in one button, then you can add it to the buttons' (Options)- section.

Please take care: If you have a form open and include a script library and AFTER that modify the library to have a function "ClearItem", then the form does not know about the function until you completely close and reopen in.

Another common error is, that the line Option Public is missing from the script- library. In that case you will never see the function in the form.

Upvotes: 2

Related Questions