You are on page 1of 2

Holy

1 Spirit Academy of Bangued


Corner McKinley, Taft St. Zone 6, Bangued, Abra
JUNIOR HIGH SCHOOL
COMPUTER 10
(Ms. Xenia Mae Flores - Teacher
Name:______________________________________Section:_________________________
Date Submitted:________________________

Module 2. Week 5
Lesson 4. Setting form, report, and control properties in Visual Basic
Lesson Objectives
At the end of the lesson, you should be able to:
a. Explain how to set form, report and control properties in VB.
b. Familiarize oneself with setting for, report and control properties.
c. Create a summary on how to set form, report and control properties.
DAY 1 and 2
LET’S EXPLORE
Last time, we have discussed about the process of creating Object or Control. Now let us move on to setting form,
report and control properties in VB. Let’s start!
Direction: Write A if you agree with the statement and D if you disagree
___1. You can set properties for these objects from within a Sub, Function, or event procedure.
___2. Code that uses the Me property executes faster than code that uses a fully qualified object name.
___3. You can refer to the Controls collection either implicitly or explicitly, but the code executes faster if you use an
implicit reference.
___4. Refer to the control in the Controls collection of the Form or Report object on which it resides. 
___5. You can use the following code to toggle the Visible property of a text box

LET’S EXPLAIN
This lecture is not in your book so please copy the important points. You can also access it online with this link:
https://docs.microsoft.com/en-us/office/vba/access/concepts/settings/set-form-report-and-control-properties-in-visual-
basic
 Form, Report, and Control objects are Microsoft Access objects. You can set properties for these objects from
within a Sub, Function, or event procedure. You can also set properties for form and report sections.
 Set a property of a form or report
**Refer to the individual form or report within the Forms or Reports collection, followed by the name of the property and
its value. For example, to set the Visible property of the Customers form to True (-1), use the following line of code:
Forms!Customers.Visible = True
 You can also set a property of a form or report from within the object's module by using the object's Me property.
Code that uses the Me property executes faster than code that uses a fully qualified object name. For example, to
set the RecordSource property of the Customers form to an SQL statement that returns all records with a
CompanyName field entry beginning with "A" from within the Customers form module, use the following line of
code:
Me.RecordSource = "SELECT * FROM Customers " _ & "WHERE CompanyName Like 'A*'"
 Set a property of a control
**Refer to the control in the Controls collection of the Form or Report object on which it resides. You can refer to
the Controls collection either implicitly or explicitly, but the code executes faster if you use an implicit reference. The
following examples set the Visible property of a text box called CustomerID on the Customers form:
' Faster method.
Me!CustomerID.Visible = True
' Slower method.
Forms!Customers.Controls!CustomerID.Visible = True
 The fastest way to set a property of a control is from within an object's module by using the object's Me property.
For example, you can use the following code to toggle the Visible property of a text box called CustomerID on the
Customers form:
With Me!CustomerID
.Visible = Not .Visible
End With
 Set a property of a form or report section
**Refer to the form or report within the Forms or Reports collection, followed by the Section property and the integer or
constant that identifies the section. The following examples set the Visible property of the page header section of the
Customers form to False:
Forms!Customers.Section(3).Visible = False
Me!Section(acPageHeader).Visible = False

DAY 3 AND 4
LET’S CREATE
Direction: Create a summary containing the process on how to Setting form, report, and control properties in Visual
Basic.
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
PARENT’S FEEDBACK
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_______________________________________________________________________________________________
_____________________________________________________________________________________________

________________________________
Signature Over Printed Name

You might also like