Userform_Initialize event failing to be called

  • Thread starter Thread starter R Avery
  • Start date Start date
R

R Avery

Suppose i have the following code:


sub MySub()
Load frmMyForm

' actions

Unload frmMyForm
end Sub


Further assume that this code executes without Breaking or otherwise
failing to execute the last statement. How come VBA often does not
raise the UserForm_Initialize event when i "Load frmMyForm"? Am I
missing something?
 
The initialize event is in the workbook module use it to
load the form but do not include any further code.

Sub MySub()
Load frmMyForm
End Sub

The unLoad function is assigned to a close command button
on the form.

Include any code for the various textboxes etc within the
form module. Double click and control to start the code
for the control. These are all Private

Regards
Peter
 
Sub Tester5()
For i = 1 To 10
cnt = i
Load frmMyForm

' actions

Unload frmMyForm
Next i

End Sub

fired every time for me.
 
Back
Top