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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between Form_Load and Form_Activate?

Status
Not open for further replies.

SkennyR

Programmer
Mar 7, 2004
157
US
What is the difference between Form_Load and Form_Activate?
 

Form load occures when the form is first loaded (Form1.Show) while the form activate event occures every time the form recieves focus from within the application...

Here give this a try ... start a new project add the code to form1 and add a new form (form2) and run...
[tt]
Option Explicit

Private Sub Command1_Click()
Form2.Show
End Sub

Private Sub Form_Activate()
MsgBox "Activate"
End Sub

Private Sub Form_Load()
MsgBox "Load"
End Sub
[/tt]

As you will notice that when you switch focus between form1 and form2 the activate msgbox appears but it does not activate between applications (run another application and switch between form1 and it.

Good Luck

 
For a bit more detail on life of a form, see thread222-343200

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top