Procedure

Prayder

Registered User.
Local time
Today, 10:48
Joined
Mar 20, 2013
Messages
303
If I have a procedure that says
Code:
Private Sub Form_GotFocus()
DoCmd.Maximize
End Sub

and a procedure that says:
Code:
Private Sub Form_Activate()
DoCmd.Maximize
End Sub

within the same forms vba,
dont they do the same thing by making the form they reference the maximum size?
 
Indeed they would do the same thing - but at different times.

The thing about a GotFocus on a form is that this event is rare. Forms normally do not get focus. They get activated. As I recall, a form cannot get the focus unless it has no controls on it that are eligible to get focus. Therefore, I would question whether this event ever fires.

By contrast, the Activate event is relatively common if you keep multiple forms or windows open on your desktop.
 

Users who are viewing this thread

Back
Top Bottom