Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to declare variables set in form proc but used after form unloaded

Status
Not open for further replies.

Natbe

MIS
Apr 4, 2003
4
US
Hello,

Word 97...

I need to know how to declare variables set in a form procedure but used after the form is unloaded.

I'm setting my variable values in my cmdOK_Click procedure, but I need to use them after I unload the form, either back in the AutoNew module or in the next user form. Where do I declare those variables, and would I just use Dim statements, or do I have to use Public statements?

Thanks,
Natelle
 
Hi Natbe,

You must use Public variables. Wherever you define them it must be in an object which will be loaded when you need to reference them (and at all times in between) so your module is probably the best bet.

Enjoy,
Tony
 
I don't really know much about Word VBA, but if this question were about Excel VBA I'd say _definitely_ declare them publicly in a standard module.

I can't imagine that word would be that different.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top