




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





Click, DblClick, GotFocus, LostFocus, MouseMove, MouseDown,MouseUp
Load, LostFocus, MouseDown, MouseUp, OnConnect, OnDiscount etc.
•Event Chart for a command button object •Click event
has a VBA Procedure attached
to it.
Private Sub Command5_Click()MsgBox "Command Button Works OK"End Sub
Mouse Click Event Happens Go to the event chart of thecommand button Run the procedure attached to it.
Program Output
attached to any objects event (event procedure) Or
written separately (without linking it to any object)
Sub procedure_name( )
statement 1statement 2 : : End Sub
..
What to write in VBA Procedures?
.
OpenForm
frmStudents
.
Caption = “New Caption”
.
Caption = “Changed Caption”
Selection Structure
If condition Then
Statement(s)
[Else
Statement(s)]
End If
Example:
If value = 0 Then
AlertLabel.ForeColor = "Red"AlertLabel.Font.Bold = TrueAlertLabel.Font.Italic = True
End If