By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

Difference between Form_Open and Form_Load?

P: n/a
Is there a difference between the Form_Open and Form_Load events? When
should I use one rather than the other? I have several forms that require
code to run when they open... or is it when they load?

Thanks in advance.
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi Deko,

Here's a partial quote from Access97 Help:
----------------------------------------------
When you first open a form, the following events occur in this order:
Open Load Resize Activate Current
If you're trying to decide whether to use the Open or Load event for your
macro or event procedure, one significant difference is that the Open event
can be canceled, but the Load event can't. For example, if you're
dynamically building a record source for a form in an event procedure for
the form's Open event, you can cancel opening the form if there are no
records to display.

When you close a form, the following events occur in this order:
Unload Deactivate Close
----------------------------------------------
HTH,
Don

"deko" <de**@hotmail.com> wrote in message
news:0Q***********@newssvr27.news.prodigy.com...
Is there a difference between the Form_Open and Form_Load events? When
should I use one rather than the other? I have several forms that require
code to run when they open... or is it when they load?

Thanks in advance.

Nov 12 '05 #2

P: n/a
deko wrote:
Is there a difference between the Form_Open and Form_Load events?
When should I use one rather than the other? I have several forms
that require code to run when they open... or is it when they load?

Thanks in advance.


Have you tried reading the Help ? :P
--
regards,

Bradley
Nov 12 '05 #3

P: n/a
Another significant difference is that the Form_Load event occurs after the
data has been loaded into the form.
So if you want to do anything with the data, you need to wait until then.

HTH
- Turtle

"deko" <de**@hotmail.com> wrote in message
news:0Q***********@newssvr27.news.prodigy.com...
Is there a difference between the Form_Open and Form_Load events? When
should I use one rather than the other? I have several forms that require
code to run when they open... or is it when they load?

Thanks in advance.

Nov 12 '05 #4

P: n/a
Turtle,

So is there a significant difference between the Load event and the Activate
event. What determines which of these to use?

Say the form moves from record 3 to record 4 and the Current event occurs. If
the current event contains code to make one or more changes to data, are the
changes made in record 3 or record 4?

Thanks!

Mark
"MacDermott" <ma********@nospam.com> wrote in message
news:f2*****************@newsread3.news.atl.earthl ink.net...
Another significant difference is that the Form_Load event occurs after the
data has been loaded into the form.
So if you want to do anything with the data, you need to wait until then.

HTH
- Turtle

"deko" <de**@hotmail.com> wrote in message
news:0Q***********@newssvr27.news.prodigy.com...
Is there a difference between the Form_Open and Form_Load events? When
should I use one rather than the other? I have several forms that require
code to run when they open... or is it when they load?

Thanks in advance.


Nov 12 '05 #5

P: n/a
I think the best way to understand this is to try it and see if it
does what you want. Make a copy of your form and data source to play
with, and see what happens when you put code in one event or the
other. I think this is the fastest way to get a feel for it.

Julia

"Mark" <mm*****@earthlink.net> wrote in message news:<pp*****************@newsread3.news.atl.earth link.net>...
Turtle,

So is there a significant difference between the Load event and the Activate
event. What determines which of these to use?

Say the form moves from record 3 to record 4 and the Current event occurs. If
the current event contains code to make one or more changes to data, are the
changes made in record 3 or record 4?

Thanks!

Mark
"MacDermott" <ma********@nospam.com> wrote in message
news:f2*****************@newsread3.news.atl.earthl ink.net...
Another significant difference is that the Form_Load event occurs after the
data has been loaded into the form.
So if you want to do anything with the data, you need to wait until then.

HTH
- Turtle

"deko" <de**@hotmail.com> wrote in message
news:0Q***********@newssvr27.news.prodigy.com...
Is there a difference between the Form_Open and Form_Load events? When
should I use one rather than the other? I have several forms that require
code to run when they open... or is it when they load?

Thanks in advance.


Nov 12 '05 #6

P: n/a
I would agree with Julia's suggestion on your second question.
(BTW - it's usually a better idea to start a new thread if you want to
bring up a new question.)

As for Load and Activate, consider this scenario:
Form1 has Button1 which runs code:
DoCmd.OpenForm "Form2"
Form2 has Button2 which runs code:
DoCmd.OpenForm "Form3"
you push Button1, see Form2
Form2's Open, Load, and Activate events fire (among others)
Now Push Button2.
Form3 opens, and gets the focus.
Close Form3
Form2 gets the focus, causing its Activate event to fire again.
Since it was already loaded, its Load event does not fire.
Note: If you move to a different application (i.e. MS Word), instead of to
a different Access form, the form's Activate event does not fire when you
return to the Access application.

HTH
- Turtle

"Mark" <mm*****@earthlink.net> wrote in message
news:pp*****************@newsread3.news.atl.earthl ink.net...
Turtle,

So is there a significant difference between the Load event and the Activate event. What determines which of these to use?

Say the form moves from record 3 to record 4 and the Current event occurs. If the current event contains code to make one or more changes to data, are the changes made in record 3 or record 4?

Thanks!

Mark
"MacDermott" <ma********@nospam.com> wrote in message
news:f2*****************@newsread3.news.atl.earthl ink.net...
Another significant difference is that the Form_Load event occurs after the data has been loaded into the form.
So if you want to do anything with the data, you need to wait until then.
HTH
- Turtle

"deko" <de**@hotmail.com> wrote in message
news:0Q***********@newssvr27.news.prodigy.com...
Is there a difference between the Form_Open and Form_Load events? When should I use one rather than the other? I have several forms that require code to run when they open... or is it when they load?

Thanks in advance.



Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.