vba - Excel Userform not initialising after first load -


i have workbook has multiple layers of userforms.

when workbook opened user presented userform has 2 command buttons, 1 selects worksheet pivottable , slicers , second opens userform containing 8 command buttons, 7 of call further individual userforms , 8 close button.

the issue have when select command button opens new userform, close second userform , reselect command button reopen second userform, second userform appears none of command buttons work nor close window (x).

the code behind first command button follows:

private sub cmd_manageabsence_click()     splashscreen.hide     load managementfunctions     managementfunctions.show end sub 

the close , terminate code on second userform follows:

private sub cmd_close_click()     unload managementfunctions end sub  private sub userform_terminate()     sheets("front").activate     splashscreen.show end sub 

i having same issues second layer of userforms, guess if first layer sorted can apply fix rest.

thanks

you should try

unload me 

instead of

unload managementfunctions 

also, might want @ difference between form.show , form.showdialog (https://msdn.microsoft.com/en-us/library/aa984358%28v=vs.71%29.aspx ... realise old page, info still valid!)


furthermore, might benefit creating form objects follows:

dim frm managementfunctions set frm = new managementfunctions frm.show 

and can use

me.hide 

instead of unload me


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -