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 > Current 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


Current Event Visual Basic Example

VBA Form Event Examples

The form Current event (or On Current event) activates when the focus moves to a record on the form. This action makes this record the 'current record'.  This event also occurs after a form is opened, requeried or refreshed.

Current Event Example:

In this example we change the field Due_Date to red when the value of this field is less than today's date and the field Completed=false.

Private Sub Form_Current()
If Me!Due_Date < Date and Me!Completed=False Then
    Me!Due_Date.BackColor = 255
Else
    Me!Due_Date.BackColor = vbWhite
End If
End Sub

The event sequence for the Current Event is:

Open → Load → Resize → Activate → Current

Contact Information

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