How does Userform get initialized by this?

  • Thread starter Thread starter RB Smissaert
  • Start date Start date
R

RB Smissaert

Trying to figure out how a Userform gets initialized.
Found that this line of code in a normal module:

strINIPath = strLocalDrive & ":\Test.ini"

Initializes this Userform.

strINIPath and strLocalDrive are Public variables, declared in a normal
module and these
variables are not used in this Userform.


I test like this:

Set MainForm = Nothing

On Error Resume Next
Msgbox MainForm Is Nothing

strINIPath = strLocalDrive & ":\Test.ini"

Msgbox MainForm Is Nothing

The second messagebox will give False.


Thanks for any insight in this.


RBS
 
If I had a userform named MainForm, then I received false for both message
boxes.

referencing a useform loads the userform.

To check if it is loaded, you have to loop through the userforms collection,
not check if it is nothing.
 
Just wondering why Mainform is not Nothing anymore after that line of code.
Maybe it is academic as I have no particular problem to solve, but just
trying to understand how this works.

RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top