Home  Fees/Services  Access Examples  Tutorials  Access Download  Articles  Search  Contact  Privacy  Links
Custom Database Design Consultants
 
Access Programming Examples
 
Access Example Downloads
Access Form Events Access Event Coding Examples
Form Event Programming
Access VBA Events

 Database Tutorials > Form Event Tutorials > Close Event

                               

After Insert Event
After Update Event
Before Update Event
On Change Event
On Close Example
On Current Event
On DblClick Event
On Error Event
On Exit Event Help
VBA Timer Event
Undo Event Method


Close Event Visual Basic Example

VBA Form Event Examples - Code Samples

Visual Basic On Close event occurs when a form is closed and removed from the screen.

On Close Event Example:

This is a subroutine we use often on the main menu of an Access database to prevent the user from attempting to get into the database objects.  In this example Microsoft Access will exit if the user closes the form.

Private Sub Form_Close()
    DoCmd.Quit
End Sub

The event sequence when closing a form is as follows:

Unload → Deactivate → Close


Contact Information

Event Procedures in MS Access
Microsoft Access 2003 2000 2002(XP) 97 All Windows Versions