How to reload a form?

Hello guys, I'm trying to reload a form displayed by using a simple button.
The sentence I was trying to use is: Form1_load() but I'm getting this error:
"Error 2 Argument not specified for parameter 'e' of 'Private Sub Form1_Load(sender As Object, e As System.EventArgs)'."

Can any of you please tell me what is that argument I'm not passing Idea or any other way to reload my form using a button

Thanks sooo much for your help...it will be much appreciated!
Best regards from Costa Rica!!!
 


Answer this question

How to reload a form?

  • Pavan Apuroop

    Just a heads up for those of you wishing to completely reload the form including all controls. You can close it and reopen it within your method. Code looks like this:

    DoCmd.Close acForm, "FormName"
    DoCmd.OpenForm "FormName"

    Make sure you replace FormName with your form's name though  Wink

  • Jason Barile MSFT

    Or you could do the following:

    OnLoad(EventArgs.Empty);

    However, you need to ask yourself what you are trying to achieve. Calling Form1_Load again will only run your code again within the method, it won't reset the form's controls to default values.

  • freedfouse

    To use methods like Form_load etc type something like it:
    Me.Form1_Load(Button1, e.Empty)

  • SoftwareDrone

    Hey, thank you very much for your replies...Smile
    I appreciate the warning also but the form I'm doing is quite simple and all I need is just to reload the form clicking the button; eventhough it won't reset the controls.
    Again thank you very much!
    Cheers,

  • Ajay Sudan MSFT

    Cole,

    That looks a lot like Access, whereas we are talking about Visual Basic .NET.



  • How to reload a form?