IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Access
Search Access Group:

Advanced
-Collapse +Expand Access To/From
To/FromCODEGuides
-Collapse +Expand Access Store
PRESTWOODSTORE
   ► KBDesktop Data...Access & VBAAccess VBA   Print This     

Access KB: Access VBA Topic


Topics

29 Articles Found in the Access VBA Topic  (or one of the sub-topics in bold above)

  KB Article    

Mike Prestwood
1. Access VBA Assignment (=)

Access uses = for it's assignment operator.

Posted to KB Topic: Language Basics
12 years ago
(1 Comments , last by verma.r )

Code
Nothing New Since Your Last Visit
5523
Hits

Microsoft Access

Mike Prestwood
2. Access VBA Associative Array (Collection)

In addition to Add and Item, collections also offer Count and Remove. Notice that Add uses the format of Value, Key (which is backwards from many other languages).

Posted to KB Topic: Language Details
12 years ago, and updated 11 years ago
(1 Comments , last by tappo.k )

Code
Nothing New Since Your Last Visit
19349
Hits

Microsoft Access

Mike Prestwood
3. Access VBA Case Sensitivity (No)

Access VBA is not case sensitive. Like VB Classic, if you type any other case for command or variable names, Access VBA will change it to the "accepted" or "defined" case. For example, if you type msgbox it is converted to Msgbox.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago
(1 Comments , last by verma.r )

Code
Nothing New Since Your Last Visit  
10535
Hits

Microsoft Access

Mike Prestwood
4. Access VBA Code Blocks (End Xxx)

Access VBAcode blocks are surrounded by statement ending keywords that all use End such as End Sub, End If, and WEnd.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago
(1 Comments , last by verma.r )

Code
Nothing New Since Your Last Visit
8661
Hits

Microsoft Access

Mike Prestwood
5. Access VBA Comments (' or REM)

Access VBA, like all the VB-based languages, uses a single quote (') or the original class-style basic "REM" (most developers just use a quote). Access VBA does NOT have a multiple line comment. Directives are sometimes called compiler or preprocessor directives. A # is used for directives within Access VBA code. Access VBA offers only an #If..then/#ElseIf/#Else directive.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago
(6 Comments , last by jsine.j )

Code

KB Post
Nothing New Since Your Last Visit
22458
Hits

Microsoft Access

Mike Prestwood
6. Access VBA Comparison Operators (=, <>)

Save as VB Classic.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago
(1 Comments , last by verma.r )

Code
Nothing New Since Your Last Visit
9440
Hits

Microsoft Access

Mike Prestwood
7. Access VBA Constants (Const kPI = 3.1459)

Scope can be Public, Global, or Private. The use of the newer Public keyword is preferred to the older Global. Private Const is the same as just specifying Const.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago
(1 Comments , last by verma.r )

Code
Nothing New Since Your Last Visit
9622
Hits

Microsoft Access

Mike Prestwood
8. Access VBA Constructors (Class_Initialize)

When an object instance is created from a class, Access VBA calls a special parameter-less sub named Class_Initialize. Since you cannot specify parameters for this sub, you also cannot overload it.

When a class is destroyed, Access VBA calls a special sub called Class_Terminate.

Posted to KB Topic: OOP
11 years ago
(1 Comments , last by verma.r )

Code
Nothing New Since Your Last Visit  
22619
Hits

Microsoft Access

Mike Prestwood
9. Access VBA Custom Routines (Sub, Function)

Access VBA is a non-OOP language with some OOP features. It offers both Subs and Functions. A Sub does not return a value while a Function does. When Subs and Functions are used in a class module, they become the methods of the class.

Posted to KB Topic: Language Details
12 years ago, and updated 11 years ago

Code

KB Post
Nothing New Since Your Last Visit
15416
Hits

Microsoft Access

Mike Prestwood
10. Access VBA Deployment Overview

You can deploy your Microsoft Access application either with the full version of Access or with the Access Runtime (see Deploying Applications Using the Access Runtime).

Posted to KB Topic: Language Basics
11 years ago

Code
Nothing New Since Your Last Visit
8679
Hits

Microsoft Access

Mike Prestwood
11. Access VBA Destructor

When an object instance is destroyed, Access VBA calls a special parameter-less sub named Class_Terminate. For example, when the variable falls out of scope. Since you cannot specify parameters for this sub, you also cannot overload it.

When an object instance is created from a class, Access VBA calls a special sub called Class_Initialize.

Posted to KB Topic: OOP
11 years ago
(1 Comments , last by Andrea.D )

Code
Nothing New Since Your Last Visit  
12726
Hits

Microsoft Access

Mike Prestwood
12. Access VBA Development Tools

Languages Focus: Development Tools

Primary development tool(s) used to develop and debug code.

Access VBA Development Tools

Microsoft Office Access is the primary tool and does include pretty good debugging features, some limited OOP features such as designing a class and instantiating an object, and, best of all, MS still has developers working on MS Access (as opposed to Corel Paradox).

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago

Code
Nothing New Since Your Last Visit
6138
Hits

Microsoft Access

Mike Prestwood
13. Access VBA End of Statement (Return)

Languages Focus: End of Statement

In coding languages, common End of statement specifiers include a semicolon and return (others exist too). Also of concern when studying a language is can you put two statements on a single code line and can you break a single statement into two or more code lines.

Access VBA End of Statement

A return marks the end of a statement and you cannot combine statements on a single line of code. You can break a single statement into two or more code lines by using a space and underscore " _".

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago

Code
Nothing New Since Your Last Visit
6103
Hits

Microsoft Access

Mike Prestwood
14. Access VBA File Extensions (.MDB)
  • .MDB - Access Database
  • .MDE - Protected Access Database
Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago

Code
Nothing New Since Your Last Visit
9853
Hits

Microsoft Access

Mike Prestwood
15. Access VBA If Statement (If..ElseIf..Else..End If)

The End If is optional if you put your code on a single line.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago

Code
Nothing New Since Your Last Visit
7348
Hits

Microsoft Access

Mike Prestwood
16. Access VBA Interfaces

Same as in VB6. Access VBA has limited support for interfaces. You can create an interface of abstract methods and properties and then implement them in one or more descendant classes. It's a single level implementation though (you cannot inherit beyond that). The parent interface class is a pure abstract class (all methods and properites are abstract, you cannot implement any of them in the parent class).

In the single level descendant class, you have to implement all methods and properties and you cannot add any. Your first line of code is Implements InterfaceName.

Posted to KB Topic: OOP
11 years ago

Code
Nothing New Since Your Last Visit
11467
Hits

Microsoft Access

Mike Prestwood
17. Access VBA Left of String (Left)

Access VBA Left of String

Posted to KB Topic: Commands
12 years ago, and updated 11 years ago

Code
Nothing New Since Your Last Visit
6534
Hits

Microsoft Access

Mike Prestwood
18. Access VBA Literals (quote)

Literals are quoted as in "Prestwood". If you need to embed a quote use two quotes in a row.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago
(1 Comments , last by Ellen.S )

Code
Nothing New Since Your Last Visit
9085
Hits

Microsoft Access

Mike Prestwood
19. Access VBA Logical Operators (and, or, not)

Same as VB. Access VBA logical operators:

and and, as in this and that
or or, as in this or that
Not Not, as in Not This

Posted to KB Topic: Language Basics
11 years ago, and updated 11 years ago
(3 Comments , last by Uwais.Q )

Code

Article
Nothing New Since Your Last Visit  
26818
Hits

Microsoft Access

Mike Prestwood
20. Access VBA Member Method (Sub, Function)

Access VBA uses the keywords sub and function. A sub does not return a value and a function does. Many programmers like to use the optional call keyword when calling a sub to indicate the call is to a procedure.

Posted to KB Topic: OOP
12 years ago, and updated 11 years ago

Code
Nothing New Since Your Last Visit
7014
Hits

Microsoft Access

Mike Prestwood
21. Access VBA Overview and History

Microsoft Access is a class-based language. Although you can create classes, Access VBA is not fully OOP. You can create classes, but not inherit from them. It is a traditional language with a few OOP extensions. You code in a traditional approach using functions, procedures, and global data, and you can make use of simple classes to help organize your reusable code. Microsoft Access is most suitable for creating business desktop applications that run within Microsoft Access for Windows.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago

Code
Nothing New Since Your Last Visit
7853
Hits

Microsoft Access

Mike Prestwood
22. Access VBA Report Tools Overview (Built-In)

Microsoft Access offers a built-in reporting tool that will suffice for most desktop database applications.

Posted to KB Topic: Language Basics
12 years ago, and updated 12 years ago
(1 Comments , last by Anonymous )

Code
Nothing New Since Your Last Visit
8806
Hits

Microsoft Access

Mike Prestwood
23. Access VBA Self Keyword (Me)

Same as VB. The Me keyword is a built-in variable that refers to the class where the code is executing. For example, you can pass Me from one module to another.

Posted to KB Topic: Language Details
11 years ago

Code
Nothing New Since Your Last Visit
11582
Hits

Microsoft Access

Mike Prestwood
24. Access VBA String Concatenation (& or +)

Although you can use either a & or a + to concatenate values, my preference is to use a + because more languages use it. However, if you use & then some type conversions are done for you. If you use + you will sometimes have to cast a value to concatenate it. For example, you will have to use CStr to cast a number to a string if you use the + operator as a concatenation operator.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago
(1 Comments , last by robert.h5 )

Code
Nothing New Since Your Last Visit
9618
Hits

Microsoft Access

Mike Prestwood
25. Access VBA Unary Operators

An operation with only one operand (a single input) such as + and -.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago

Code
Nothing New Since Your Last Visit
8273
Hits

Microsoft Access

Mike Prestwood
26. Access VBA Variables (Dim x as Integer)

Access VBA is a loosely typed language. Declaring variables is optional unless you use the Option Explicit statement to force explicit declaration of all variables with Dim, Private, Public, or ReDim. Using Option Explicit is strongly recommended to avoid incorrectly typing an existing variable and to avoid any confusion about variable scope. Variables declared with Dim at the module level are available to all procedures within the module. At the procedure level, variables are available only within the procedure.

Posted to KB Topic: Language Basics
12 years ago, and updated 11 years ago
(2 Comments , last by Sabina.J )

Code

KB Post
Nothing New Since Your Last Visit
15173
Hits

Microsoft Access

Mike Prestwood
27. DAO versus ADO

My Access Application still uses DAO and I'm thinking about migrating it to ADO. Should I?

Posted to KB Topic: Using Data
12 years ago

FAQ
Nothing New Since Your Last Visit
8983
Hits

Microsoft Access

Wes Peterson
28. Don't overlook the power of a relational database! Access is a wonderful desktop database. It makes it easy to do so many things. Many beginning users, though, fail to take advatage of one of Access's greatest strengths.
Posted to KB Topic: Language Basics
13 years ago, and updated 13 years ago
(2 Comments , last by cruz.j )

KB Post
Nothing New Since Your Last Visit
9528
Hits

Microsoft Access

Mike Prestwood
29. Watch Your Access Evaluations!

Execute more common evaluations first! Short-circuit evaluation is a feature of most languages where once an evaluation evaluates to False, the compiler evaluates the whole expression to False, exits and moves on to the next code execution line. In Access VBA, the if statement does not support short-circuit evaluation but you can mimic it. Use either an if..else if..else if statement or nested if statements. You will find that your code that makes use of this technique will be clearer and easier to maintain than the short-circuit equivalent and will execute faster than ignoring this issue.

Posted to KB Topic: Language Basics
12 years ago

Tip
Nothing New Since Your Last Visit
8606
Hits

Microsoft Access

Icon Legend:
Since your last logged visit:
- New to you or updated since your last visit (sign in now to activate).
- NOT new to you since your last visit (sign in now to activate).

New Microsoft Access Knowledge Base Post...

Share your knowledge with the WORLD! In addition to adding comments to existing posts, you can post knowledge you've acquired. We welcome full articles (intro with screen shots), general posts (shorter), and tidbits (tips, FAQs, definitions, etc.).

Post New...

Tidbit Post: Short Flashcard FAQ Definition Quick Tip Code Snippet
Longer Post: Full Article General Post File Link Error News
Other: Blog Topic
Or, if YOU have a question...
  Microsoft Access Message Board
Sales Website: www.prestwood.com Or visit our legacy sales site: 
legacy.prestwood.com


©1995-2020 Prestwood IT Solutions.   [Security & Privacy]