Hey I got a real noob question for yahs :), I have just never had to do it. I need to know how to reload a form so that all its values are set back to the time it was originally loaded.
Thanks heaps in advance.
Printable View
Hey I got a real noob question for yahs :), I have just never had to do it. I need to know how to reload a form so that all its values are set back to the time it was originally loaded.
Thanks heaps in advance.
Hi.
Try to do the following from another form or module:
It should work.Code:Unload frmMyForm
frmMyForm.Show
Regards,
Michael
Yeah I tried that and instead of the .show I used .visible = true, but both dont actually do all the commands within the form load.
I dont get why that doesn't work because it is logical that it would close down the form and "HAVE TO" reload it and therefore re do the code in the Form_load. But it doesn' seem to, please I really need to know how to overcome this problem. Thanks for your help though Micheal
Following code does NOT call Form_Initialize, but calls Form_QueryUnload, Form_Unload, Form_Load (generated by Unload & Load) and all other events generated by Show() method:Best regards,Code:Sub reloadForm(frm As Form)
Unload frm
Load frm
frm.Show
End Sub
Thanks heaps hey, the code
Unload frm
Load frm
frm.Show
worked. But I just dont understand what the difference is between
Unload frm
Load frm
frm.Show
and just
Unload frm
Load frm
If you don't call Unload, then Load will be ignored. So, you must call Unload before, and that also means closing the form. Load call doesn't bring back the window for you, thus you have to call Show, to make the form visible again.
If you'd like to understand more about the events generated, create a test project and put message boxes or log in a file all the events of a form object. Then, play around with that form and try calling all it's methods, plus load & unload. Study the dumped log to understand when each event is generated.
I can assure you that will be useful information.
Regards,