Scope of global public Sub only seems available on Form, not document

Hello!I’ve been searching Help files and forums. Both seem to tell me that I need to globally declare a Sub for it to be available, but something is just not adding up.

I have a Global public sub. I can acess the sub just fine from LS inside a button on the form.

Where I can’t get to it (not a sub or function name) is when I create a new document based on the form, and create a Button in a rich-text field and try to access it from THAT button.

I can’t use a script library as this document is to be mailed (the form is stored).

My Global declarations are passing over to the document, which tells me that what I have been reading is correct - I need to declare this Sub prior to writing the code behind it.

However, every time and it seems every possible syntax case, I get a different error (already declared, procedures may not be forward declared, etc. etc).

Any ideas? Or is this just not possible?

Any ideas are appreciated, while I do have lots of hair, I’m afraid that might not be the case by the end of the day.

Thanks!!

Jess :slight_smile:

Subject: Scope of global public Sub only seems available on Form, not document

Problem solved: it was a loose nut behind the keyboard. :wink:

I always take the LONG way around when I don’t have to. PostRecalc code is the way to go.

Thanks John!

Jess :slight_smile:

Subject: Use the PostRecalc, Luke

:slight_smile: