473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Difference between Form_Open and Form_Load?

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
6 26640
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: deko | last post by:
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...
3
by: Frank Rizzo | last post by:
In vb6, you could do all the resizing of the form (and its constituent controls) in the form_load event, knowing that the form won't show up until the Form_load event was exited. In my vb.net...
5
by: matthewtec | last post by:
This may be something that is painfully easy and I'm just missing, or it could be something that I should learn a bit more in order to do. But, if I have a simple windows form application, with...
2
by: =?Utf-8?B?VG9u?= | last post by:
Hello, I want to understand teh benefits of ajax technology. Does anyone has a good website where AJAX EXTENSIONS is worked out so I really understand it. There a 2 main questions: 1) How about...
34
by: Smithers | last post by:
I have some logic that populates UI controls with values from App.config. A couple of checkboxes get checked or unchecked; and items loaded into a checked list box. Two reasonable places to put...
5
brightshadow
by: brightshadow | last post by:
I have a super simple Access DB with four tables and one form.. I'm an old hand at Excel VBA but am just starting with Access, so this is likely a totally stupid question, but here goes anyway. In...
2
by: ezechiel | last post by:
Hi, I have the following (limited to problem): 2 tables: software (sw_id (pk), sop_id(fk)) sop(sop_id, sop_name, sop_nr) In the form (actually a software record): - a combobox ...
2
by: titli | last post by:
Working on Visual Basic for MS access applications. By mistake I have inserted a msgbox in the Form_open event of my code(xyz.mdb) in frmMain.Ofcourse wht i was trying to print was incorrect. ...
3
by: titli | last post by:
Working on VBA access By mistake I have inserted a msgbox in the Form_open event of my code(xyz.mdb) in frmMain. Now when I try to open it , i get error message number 13 , Type mismatch error...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.