Form_load routine does not work

Asked

Viewed 71 times

1

I have a form 'frmPerfis' that when opening it executes the routine 'Rotinarefresh' (to update data from a listview) that is inside the 'Form_load'. Inside this form has the form 'frmPerfisAlter' and when I call it and save the changes in the record it saves the information and then does the following (closes the current form and goes to the 'frmPerfis':

... Unload Me frmPerfis.Show ...

When opening 'frmPerfis' I understand that the 'Form_load' routine (the 'Rotinarefresh') should be executed so that the listview comes with the updated data. But this does not occur. How can I make it work?

  • I used after Unload Me the code: ... Call frmPerfis.Rotinarefresh ... I put 'Rotinarefresh' as public and called it another form.

1 answer

0

What is appearing is that the form "frmPerfis" was not downloaded after invoking the form "frmPerfisAlter".

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 as I depend on the "response" of another person I usually open in vbmodal and wait for its execution.

Dim f2 As frmPerfisAlterar

Set f2 = New frmPerfisAlterar

f2.Show vbModal

Call RotinaRefresh

Set f2 = Nothing

Browser other questions tagged

You are not signed in. Login or sign up in order to post.