Microsoft KB Archive/173684: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
(One intermediate revision by the same user not shown)
Line 62: Line 62:
When you close a form, the following sequence of events occurs for the form:<br />
When you close a form, the following sequence of events occurs for the form:<br />


<pre class="fixed_text">  Unload =&gt; Deactivate =&gt; Close
<pre class="fixed_text">  Unload => Deactivate => Close
                 </pre>
                 </pre>
<br />
<br />
When you close a report from Print Preview view or when the report closes automatically after the Print event has occurred, the following sequence of events occurs for the report:<br />
When you close a report from Print Preview view or when the report closes automatically after the Print event has occurred, the following sequence of events occurs for the report:<br />


<pre class="fixed_text">  Close =&gt; Deactivate
<pre class="fixed_text">  Close => Deactivate
                 </pre>
                 </pre>
<br />
<br />
Line 81: Line 81:
</p>
</p>
<pre class="codesample">      Private Sub Form_Deactivate()
<pre class="codesample">      Private Sub Form_Deactivate()
         MsgBox &quot;Deactivate event&quot;
         MsgBox "Deactivate event"
       End Sub
       End Sub
                         </pre></li>
                         </pre></li>
Line 87: Line 87:
</p>
</p>
<pre class="codesample">      Private Sub Form_Close()
<pre class="codesample">      Private Sub Form_Close()
         MsgBox &quot;Close event&quot;
         MsgBox "Close event"
       End Sub
       End Sub
                         </pre></li>
                         </pre></li>
Line 106: Line 106:
</p>
</p>
<pre class="codesample">      Private Sub Report_Deactivate()
<pre class="codesample">      Private Sub Report_Deactivate()
         MsgBox &quot;Deactivate event&quot;
         MsgBox "Deactivate event"
       End Sub
       End Sub
                         </pre></li>
                         </pre></li>
Line 112: Line 112:
</p>
</p>
<pre class="codesample">      Private Sub Report_Close()
<pre class="codesample">      Private Sub Report_Close()
         MsgBox &quot;Close event&quot;
         MsgBox "Close event"
       End Sub
       End Sub
                         </pre></li>
                         </pre></li>
Line 127: Line 127:
== REFERENCES ==
== REFERENCES ==


To find more information about events and their sequence, search the Help Index for &quot;sequence of events&quot;, or ask the Microsoft Access 97 Office Assistant.
To find more information about events and their sequence, search the Help Index for "sequence of events", or ask the Microsoft Access 97 Office Assistant.


</div>
</div>

Latest revision as of 11:06, 21 July 2020

Article ID: 173684

Article Last Modified on 1/20/2007



APPLIES TO

  • Microsoft Access 2.0 Standard Edition
  • Microsoft Access 95 Standard Edition
  • Microsoft Access 97 Standard Edition



This article was previously published under Q173684

Moderate: Requires basic macro, coding, and interoperability skills.


SUMMARY

The sequence of the Deactivate and Close events for a Microsoft Access form are the reverse of the Close and Deactivate events in a Microsoft Access report.

MORE INFORMATION

When you close a form, the following sequence of events occurs for the form:

   Unload => Deactivate => Close
                


When you close a report from Print Preview view or when the report closes automatically after the Print event has occurred, the following sequence of events occurs for the report:

   Close => Deactivate
                


Note that a form's Close and Deactivate events are the reverse of the Deactivate and Close events of a report.

Steps to See this Behavior in a Form


  1. Open the sample database Northwind.mdb (or NWIND.MDB in Microsoft Access 2.0).
  2. Open the Employees form in Design view.
  3. Set the form's OnDeactivate property to the following event procedure:

          Private Sub Form_Deactivate()
            MsgBox "Deactivate event"
          End Sub
                            
  4. Set the form's OnClose property to the following event procedure:

          Private Sub Form_Close()
             MsgBox "Close event"
          End Sub
                            
  5. Save and close the form.
  6. Open the Employee form in Form view.
  7. Close the form.

    Note that the Deactivate message appears before the Close message.

Steps to See this Behavior in a Report


  1. Open the sample database Northwind.mdb (or NWIND.MDB in Microsoft Access 2.0).
  2. Open the Customer Labels report in Design View.
  3. Set the report's OnDeactivate property to the following event procedure:

          Private Sub Report_Deactivate()
            MsgBox "Deactivate event"
          End Sub
                            
  4. Set the report's OnClose property to the following event procedure:

          Private Sub Report_Close()
             MsgBox "Close event"
          End Sub
                            
  5. Save and close the report.
  6. Open the Customer Labels report in Print Preview view.
  7. Close the report.

    Note that the Close message appears before the Deactivate message.


REFERENCES

To find more information about events and their sequence, search the Help Index for "sequence of events", or ask the Microsoft Access 97 Office Assistant.


Additional query words: inf 95 8.00

Keywords: kbinfo KB173684