PRB: Formset.LOAD Is Not the First Event to Fire (129571)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
This article was previously published under Q129571 SYMPTOMS
When a form set contains a Data Environment, the BeforeOpenTables event and
the OpenTables method of the Data Environment are triggered before the Load
event of the form set. This article explains the reason behind this
implementation and offers a workaround if you want the Load event to
execute before the tables are opened.
CAUSE
The Load event of a form set usually sets the environment of a form. In
particular, it can be used to bind data to controls on a form. Therefore,
in most cases, tables and views must be loaded before the LOAD event of a
form set is executed. Thus, the OpenTables method of the data environment
is, by default, called before the Load event of the form set is executed.
WORKAROUND
If you do not want the tables or views to be opened when the Load event of
a form set is executed, set the AutoOpenTables property of the form to .F..
You can then call the OpenTables method of the data environment to open the
tables automatically. For example, use the following command in any method
of the form:
THISFORMSET.DataEnvironment.Opentables
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 2/12/2000 |
---|
Keywords: | KB129571 |
---|
|