Routine Form_Load does not work

1

I have a form 'frmPerfis' which when open it executes the routine 'RoutineRefresh' (to update data from a listview) that is inside the 'Form_Load'. Inside this form has the form 'frmPerfisAlterar' and when I call and save the changes in the registry it writes the information and then does the following (closes the current form and goes to 'frmPerfis':

...     Unload Me         frmPerfis.Show ...

When opening 'frmPerfis' I understand that the 'Form_Load' routine (the 'RoutineRefresh') should be executed in order for the listview to come up with the updated data. But this does not happen. How can I make this work?

    
asked by anonymous 26.03.2016 / 01:29

1 answer

0

What is appearing is that the form "frmPerfis" was not unloaded after invoking the form "frmPerfisChange".

What I usually do to not leave the form loaded and the variables filled is to create an object and work with it.

Dim f2 As Form2

Set f2 = New Form2

f2.Show

Call Unload(Me)

Set f2 = Nothing

Or, depending on the "response" of another form, I usually open in vbmodal and wait for it to execute.

Dim f2 As frmPerfisAlterar

Set f2 = New frmPerfisAlterar

f2.Show vbModal

Call RotinaRefresh

Set f2 = Nothing
    
05.04.2016 / 19:47