2 userforms, 2 UserForm_Initialize()

  • Thread starter Thread starter Charlie
  • Start date Start date
C

Charlie

To refresh the form, I just call UserForm_Initialize()
(Because I discovered .hide & .show again doesn't do this)
But both userforms I have have UserForm_Initialize() even though I named
both userforms something else. Does this matter. My code seems to know to
call the UserForm_Initialize() on the active form...
 
If you are using comboboxes or listboxes on userforms they don't empty
automatically. They maintain the values you last put into them even if you
close your workbook and re-open the workbook. You must perform a .clear to
empty these boxes.

Now for your question. You can use the initialize function if the
initialize function does everything you need it to do. Does your Initialize
function clear comboboxes and listboxes?
 
Intesting to know that answer to my unasked ?

....I have my userform_Initialize() to fill lots of textboxes, combos, and
many labels from several worksheets. But if it's not kosher to call
userform_Initialize() I can just put my form loading code under a private sub
and call that from userform_Initialize...
thanks.
 
What ever works! I usually perform a clear, load my boxes and then execute
the .show. Putting the clear and load into the initialize also works.
 
If you unload the form after each use instead of hiding it, then when you use
..show it will automatically invoke load and initialize.
 
ah, that's the word I was looking for, unload. That'll do what i need, nicely.
 
I put:
Unload SchedulesForm
Load SchedulesForm
....so as to reload everything on the form, but the unload function seems to
shut down the whole code...
 
I have this problem, too. I have two forms loaded, frm1 and frm2, and
when I use "Unload frm1", it unloads them both.
 

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