Professional Documents
Culture Documents
Access VBA Programming For Beginners - Class 1 - : by Patrick Lasu
Access VBA Programming For Beginners - Class 1 - : by Patrick Lasu
com
Class 1 - Overview
What is VBA? History of VBA Event-Driven Programming Helpful Hints Code Window Help in VBA Subs and Functions Variables and Constants
What is VBA?
VBA = Visual Basic for Applications Visual Basic is a stand-alone programming software that is event-driven VB for Applications = Visual Basic that is customized to work with Access, Excel, Word, etc.
Excel has Sheet objects Word has Document objects Access has Data objects
Brief History
Visual Basic for Applications (VBA) is derived from Visual Basic (VB)
VBA was fully integrated into Office 97 except Outlook Prior to that, there were Macros
Brief History
Brief History
Software Platform for VB
VB
Windows
CPU
Brief History
Software Platform for VBA
VBA
Access Windows CPU
Event-Driven Programming
What is it?
Code does not execute until an event is happening
Analogy: You answer the phone when it rings instead of picking up the receiver every 2 seconds to find out if somebody is calling.
Program is Form-centric
Code uses forms, which breaks up code into smaller portions, and gives the user flexibility when entering data.
Helpful Hints
There are at least 3 ways of accomplishing the same task when coding
Good Code = It works Bad Code = It does not work
A variable is a storage for a value that can change during code execution
Answering Yes or No
A constant is a storage for a value that does not change during code execution
3.1415, vbYes, vbRed Can be changed manually
Going from 365 days to 360 days when calculating interest
There are several Data Types for Variables and Constants for efficiency
String = Stores Text Patrick, 123 Main St Number = Stores Numbers - 1, 2, 3,..., 3.14 Boolean = Stores True/False Date = Stores Date Currency = Currency format Dollar, Yen Variant = Stores Anything
Review
There are at least 3 different ways of coding Save Often Use the Help files