Documente Academic
Documente Profesional
Documente Cultură
Logical Operators
2. FormatNumber(Expression)
syntax : FormatCurrency(Expression [,
NumberOfDecimalPositions [, LeadingDigit
[,
UseParenthesisForNegative [,
GroupForDigits] ] ] ]
3. FormatPercent(Expression)
Syntax : FormatPercent( Expression [, _
NumberOfDecimalPositions [, LeadingDigit
_ 2
[, UseParenthesisForNegative [,
GroupForDigits ] ] ] ]
4. FormatDateTime(Expression)
Syntax : FormatDateTime( Expression [,
NamedFormat] )
Properties
Properties tell something about an object, such as its
name, color, size, location on the form etc. You can
think of properties as adjectives that describes
objects. There are some properties that are only
available at design time, some only during run time
and some are available during both.
When you refer to a property, the name of the object 2
is written first followed a period ( . ) and then the
property name. For example the Text property of a
TextBox called txt1 will be written as
txt1.Text
Methods
Actions associated with objects are called Methods.
Methods are verbs of object-oriented programming.
Some common methods are Print, Resize, Clear etc.
You refer to methods as
ObjectName.Method Name
Ex. Form1.Print
Q2. i) Dynaset 2
C A Dynaset is a temporary set of data taken from one
or more tables in a databse. A dynaset may be a
querry that was defined in an Access database, a
single table, a table subset of a table, or the result of
joining multiple tables. Like a table, a dynaset is
updatable if the database is not locked or opened for
ReadOnly. Dynasets are updated every time the user
changes the database, and changes they make to the
corresponding RecordSet are reflected in the
underlying tables. It is the most powerful and flexible
type of a recordset.
ii) Itemdata 2
This is a property for ListBoxes and ComboBoxes
which is useful while working with indixes. The
ItemData property can associate a specific number
with each item in the list. Each element of the list
property can have a corresponding ItemData that
does not change even when the list is sorted.
You can set initial values for the ItemData property,
just as you set the initial values for the List property. If
you add an item to the list during run-time, you can
also add a corresponding value to the ItemData
property.
Syntax : Object.ItemData(Index) = Value
The values placed in the ItemData property need not
be in any sequence.
2
iii) Snapshot
A Snapshot recordset, like a dynaset may be taken
from one or more tables. The difference is that the
Snapshot is not updatable and are also not live. A
snapshot recordset is like a photograph – a picture of
reality at any given point in time. 2
iv) NewIndex
It is a property for a ListBox or a ComboBox Control. If
the list is sorted the AddItem method adds the new
item alphabetically in the list. You can determine the
index of the new item using the NewIndex property,
which VB will set to the index of the new item. The
NewIndex property can be used with sorted as well as
unsorted list.
Example : list1.AddItem text1.Text
List1.ItemData(list1.NewIndex) = text2.Text
Property Get
Syntax: [Public] Property Get
ProcedureName( Optional _ 2
ArgumentList ] ) [ As Datatype ]
‘statements in Procedure
ProcedureName = PropertyName
End Procedure
Property Let
Syntax: [Public] Property Let
ProcedureName( Optional _
ArgumentList , ] IncomingValue [ As
Datatype ] )
‘statements in Procedure
PropertyName = IncomingValue
End Procedure
Q3. 1) If……..Then…….Else 2
B 2) Nested If 2
Example using option Buttons 2
Q4. Rules
A i) Must begin with a letter 3
ii) Cannot contain an embedded period or any of
the type decleration character
iii) Should not exceed 255 characters
iv) Must be unique within its scope
Naming conventions
i) Must be meaningful
ii) Should have a lower case prefix that specifies 3
its datatype
iii) Capitalize each word of the name following the
prefix
Q4. Validation 2
C Program (Any logic can be used) 6
Sample Program
Q7. i) 1234.45 v) 0 1
A ii) 0 vi) 1234 0
iii) 0 vii) 12.23
iv) 1 viii) 100