Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reloading a VB Form

Status
Not open for further replies.

Gaff

Programmer
Dec 13, 2001
30
0
0
IE
Is it possible to reload a form after it has been loaded initially. Is there some kind of refresh property perphaps?? I'm updating my database using the form and other details on the form are being retrieved from the database and i want to just refresh these details. Thanks.
 
Yes, forms have a "Refresh" method you can access via code.

Example: Form1.Refresh

This does not cause the form to actually "reload" though. It only causes it to be repainted. If you want to perform everything that happens in the Form_Load routine again then I suggest putting it into its own routine which you can then call in Form_Load, as well as at any other time you wish.
 
If all the code that initialises your control in is an event procedure, you could declare the procedure as public and manually call it...

do Form1_Load

If you're working with DAO controls, they have a updatecontrols method that will automatically update all bound controls, if that's any good to you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top