This article discusses a programming technique I used in a Microsoft Access database application to display a multiple page PDF document and make it position itself at a specific page.
Queries on a Microsoft Access database linked to MySQL tables failed with errors like ODBC--data out of range and the VBA code not recognizing fields from a sub-form query definition, insisting that it could not find the fields that I was referencing (Microsoft Access cannot find the field "fieldname" referred to in your expression).
In Access VBA, you have to add an empty string to the value being compared in order to get consistent results. For example, add &"" to your string varilable or it's code equivalent &vbNullString. Then compare to an empty string or verify it's length to 0 with Len.
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.
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.
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.
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.
This article discusses a programming technique I used in a Microsoft Access database application to display a multiple page PDF document and make it position itself at a specific page.
Queries on a Microsoft Access database linked to MySQL tables failed with errors like ODBC--data out of range and the VBA code not recognizing fields from a sub-form query definition, insisting that it could not find the fields that I was referencing (Microsoft Access cannot find the field "fieldname" referred to in your expression).
In Access VBA, you have to add an empty string to the value being compared in order to get consistent results. For example, add &"" to your string varilable or it's code equivalent &vbNullString. Then compare to an empty string or verify it's length to 0 with Len.
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.
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.
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.