Here are 3 chapters of a book I started writing on programming with VBA
-- the first part of the book uses Excel to program
-- and then, the chapters that aren't written (yet?) go into Access.
The basics of VBA are the same no matter what you use.
This would be excellent for you to read and it shouldn't take that much time
... print it out and read a chapter each night before you go to bed
... no hands on, just reading for these chapters.
-
Chapter 1 -- Getting Started Programming
Although this chapter uses Excel to demonstrate VBA,
the basics of VBA are the same in any application.
If you learn about VBA code for Excel,
you will know it for Access as well.
The reason that Excel is used is because there is a bult-in macro-recorder,
so it is easy to translate what you are clicking and picking into code.
The best way to learn VBA (on your own) is to record what you do and then examine the code that is created.
The code that the macro recorder writes is often clunky,
so knowledge of streamlining things helps out
tremendously.
Become familiar with the VBE (Visual Basic Editor) window,
Create and Run simple programs, Get Help.
- Creating a simple program
- Modifying code
- Testing a Return Value – Using Parenthesis
- Getting Help
- Getting User Input
-
Chapter 2 -- Defining Variables
This chapter includes a good reference for the main data types you can use when programming.
The concept of data types is also especially important when you are setting up tables and fields in Access.
Understand Variables and Data Types,
AutoComplete,
Indent code,
Option Explicit and Option Base statements
- Variables
- Dim Statement
- Option Explicit
- Variable Names
- Data Types and Dim Examples
- AutoComplete
- Indenting Code
- TypeName Function
- Arrays
- Option Base Statement
-
Chapter 3 -- Syntax
Syntax is the structure of the word order in a line of code. Code lines are composed of Statements. A Statement can declare, define, calculate, test, assign,
label, do …. Statements must be syntactically complete and correct.
I had intended to finish this book, but have yet to finish this chapter ...
my intention was to provide more code examples ... but life being what it is, that didn't happen.
Even still, this book is a valuable reference and a great introduction to the world of VBA.
Become familiar with VBA syntax.
Understand Objects, Properties, and Methods.
- Syntax
- If … Then … Else … End If
- Select Case … Case … Case Else … End Select
- Do...Loop
- For...Next
- While...Wend
- Objects
- Properties
- Methods
- Containers
- Getting Help
- Object Browser
- Reference Libraries
- VBA Library
- Other Reference Libraries
- Change or check references
for information on private programming and training,
or if you have comments and ideas, I'd love to hear from you
© Copyright 2009 Crystal Long. All rights reserved.
Last Updated: July 15, 2009
|