Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 2 userforms, 2 UserForm_Initialize()

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...


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 2 userforms, 2 UserForm_Initialize()

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?

"Charlie" wrote:

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...


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 2 userforms, 2 UserForm_Initialize()

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.

"Joel" wrote:

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?

"Charlie" wrote:

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...


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 2 userforms, 2 UserForm_Initialize()

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.

"Charlie" wrote:

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.

"Joel" wrote:

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?

"Charlie" wrote:

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...


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 2 userforms, 2 UserForm_Initialize()

If you unload the form after each use instead of hiding it, then when you use
..show it will automatically invoke load and initialize.

"Charlie" wrote:

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...




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 2 userforms, 2 UserForm_Initialize()

ah, that's the word I was looking for, unload. That'll do what i need, nicely.
"JLGWhiz" wrote:

If you unload the form after each use instead of hiding it, then when you use
.show it will automatically invoke load and initialize.

"Charlie" wrote:

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...


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default load & unload

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...

"JLGWhiz" wrote:

If you unload the form after each use instead of hiding it, then when you use
.show it will automatically invoke load and initialize.

"Charlie" wrote:

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...


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default load & unload

I have this problem, too. I have two forms loaded, frm1 and frm2, and
when I use "Unload frm1", it unloads them both.

Charlie wrote:
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...

"JLGWhiz" wrote:

If you unload the form after each use instead of hiding it, then when you use
.show it will automatically invoke load and initialize.

"Charlie" wrote:

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...


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm_Initialize Edwin Tam[_7_] Excel Programming 1 April 13th 06 04:49 PM
UserForm_Initialize Bob Phillips[_6_] Excel Programming 1 April 13th 06 04:43 PM
UserForm_Initialize error Jennifer Excel Programming 3 April 24th 05 09:58 PM
UserForm_Initialize() Joe Derr[_2_] Excel Programming 3 December 4th 04 04:23 AM
UserForm_Initialize Rob Excel Programming 2 January 15th 04 02:00 PM


All times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"