Knowledge Base
Defining a Variable Dim statement Dim intXX As Integer Public in a Module Public dblNN As Double
Setting A Variable Assignment Statement Variable or Property = Expression Expression is evaluated Result is Assigned to the Variable
Example Label.Caption = Format(Val(Text.text),”currency”) Let Text.text contain “14.55”
Example Val(Text.text) is Val(“14.55”) Evaluates to the number Format(14.55,”currency”) Evaluates to “$14.55” Assigned to Label.Caption Gives Label.Caption the contents “$14.55”
Getting User Input Text boxes Let the user type input data Val is used to convert to numbers Can be stored in Variables Can be stored in other objects properties
Displaying Output Label Box Captions Label.Caption = a string Label.Caption = Format(number, “type”)
Jumping to Modules Events
Testing Conditions If Then If condition Then code End If If condition Then code Else code End If
Conditions Comparisons of like types Equal = Less Than < Greater Than > Not Equal <>
Conditions Less Than or Equal <= Greater Than or Equal >=
Logical Operators Evaluate relationship between two Truth [Boolean] conditions And Or
And X And Y is
Or X Or Y is
Select Case Select Case expression Case value code Case value code Case Else code End Select
Option Buttons One and only Value is True per Container Container can be a –Form –Frame
Check Boxes One or more can have the Value Checked –0 unchecked –1 checked –2 grayed
MsgBox Function Resp = MsgBox(“prompt”, vbKeys, “Title”)