
Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Jonathan,
Thanks for the reply. I had actually seen the Terminate event and even read
the Help file on it, and while it sounded promising, I wasn't sure that it
was what I needed. What can I say, it was 4:30 AM! :-)
I have never heard of Unload Me, and I can't find anything on it in Help. I
understand the point that you are making with that recommendation, but I
don't think that I need to worry about multiple instances of the form. I
try to write my code so that each time a user form is loaded, it gets
unloaded before the user can do anything else.
In this particular case, the user form is displayed only when the user
clicks a button on a custom toolbar--it is not loaded by any other routines.
The user form does just one highly specific thing, and it stays on the
screen until the user is done with the task, at which point there is no
reason to keep it open, so it gets unloaded.
I explain all this only because I have not been able to find any info in
Help regarding Unload Me, so I'm unclear as to whether or not it would
benefit me in this case. I suspect that given the particular circumstances
of how this user form is being used, I'm probably okay with referring to the
user form by name in the Unload command. Please let me know if this is not
correct.
-- Tom
State of Montana
Department of Justice Help Desk
"Making the world a safer place."
> Hi Tom,
>
[quoted text clipped - 70 lines]
> >
> > --Tom
Jonathan West - 02 Nov 2004 11:08 GMT
The Me keyword is listed in the VBA help file. "Me" refers to the instance
of a class or UserForm containing the code that uses the keyword.
In most cases, code within a form should refer to Me rather than to a named
instance of the form. If you do this, you are protected from the following
potentialproblems
- the code failing if you change the name of the form
- the code getting mixed up if you have multiple instances of the form
In your particular case, where you only use one instance of the form under
one name, then it doesn't matter all that much. But if you get into the
habit of using the Me keyword, then your code becomes that much more robust
if you decide to change the use of a form.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
> Jonathan,
>
[quoted text clipped - 119 lines]
>> >
>> > --Tom
Montana DOJ Help Desk - 09 Nov 2004 02:46 GMT
Okay, I found the ME keyword in the VBA Help. I generally use the search
function to find stuff, and just didn't think about going to the Contents
and browsing the keywords (Doh!).
-- Tom
State of Montana
Department of Justice Help Desk
"Making the world a safer place."
> The Me keyword is listed in the VBA help file. "Me" refers to the instance
> of a class or UserForm containing the code that uses the keyword.
[quoted text clipped - 134 lines]
> >> >
> >> > --Tom