Assistant Object

Because of its professional graphics and animation, the Assistant object is a popular Microsoft Office Object to work and learn with. More than likely, you have already seen the Assistant object with Microsoft applications such as Microsoft Word, Microsoft Excel, and Microsoft Access. In a nutshell, the Assistant object exposes the animated Microsoft assistant. Depending on the version of Microsoft Office you have, there are up to eight Office assistant characters you can install. To manually...

Creating Data Access Pages

Access Record Navigation Section

You can create data access pages with either the Access Data Access Page wizard or by yourself in Design view. To create a data access page in design view, simply double-click the Create Data Access Page in Design View link from the Pages window in Figure 12.1. Data access pages created in Microsoft Access 2003 cannot be opened in Design view in older versions of Access. In other words, Access 2003 data access pages are not backward-compatible. When creating a new Access 2003 data access page,...

The Vba

Access Vba Toolbar

If you've written programs in Visual Basic before, the VBA integrated development environment IDE should feel very familiar to you. If not, don't worry the VBA IDE is user friendly and easy to learn. For ease of use, I refer to the VBA integrated development environment as the Visual Basic Editor, or VBE, from now on. The VBE contains a suite of windows, toolbars, and menu items that provide support for text editing, debugging, file management, and help. Two common ways for accessing the VBE is...

Option Buttons

Vba Access Option Button

Often referred to as radio buttons, option buttons provide a user with a list of selectable choices. Specifically, the user can select only one option at a time. Individual option buttons comprise two controls, a label, and option button. Each has its own properties and can be managed during design time or runtime. After creating an option group either manually or with the Option Group Wizard, you should change the name of each option control to one that contains a meaningful description. This...

Introduction to Microsoft Office Objects

In addition to objects such as DoCmd, Err, Debug, as well as objects found in the ADODB library, VBA provides the Microsoft Office Object model for use in the suite of applications found in Microsoft Office. Most of the Microsoft Office Objects can be used across the Microsoft Office suite of applications such as Microsoft Word, Microsoft Excel, and Microsoft Access. Some office objects, however, are application specific. To work with the examples in this chapter, ensure that your Access...

Compound If Blocks

So far, you've seen how to build simple and nested conditions using If blocks. There is, however, much more to consider if you plan to build more complex decision-making capabilities such as compound conditions into your VBA applications. To build compound expressions, VBA programmers can use the conditional operators And, Or, and Not. Conditional operators such as And, Or, and Not are considered reserved keywords and must be used in an expression. Otherwise, VBA will generate a compile error....

Working with Class Modules

Vba Class Object

Classes are the blueprints for an object. They contain the implementation details, which are hidden from users programmers who use your custom objects . In object-oriented programming with VBA, classes are implemented as class modules. Class modules do not exist in memory. Rather, the instance of the class known as the object does. Multiple instances of a single class can be created. Each instance object created from a class shares the same access to the class's methods and properties. Even...

Property Procedures

Excel Vba Class Module For Animation

VBA provides property procedures for managing the attributes of a class, which are exposed internally for the class to use or exposed externally as object properties. Simply put, properties are just variables. You could simply declare variables in your class modules for your procedures to use, but that would defeat the purpose of object-oriented programming. To work with properties in VBA, you create variables of various scopes and use a combination of property procedures to manage them. VBA...

Balloon Object

With the help of the Assistant object, you can even create your own specialized balloons. Balloons are the graphical text area that the Office assistant uses to display information. To create custom balloons, simply access the NewBalloon property from the Assistant object. The NewBalloon property returns a new Balloon object that contains its own methods and properties for managing custom balloons. You can customize your balloons to include labels, check boxes, icons, and various button and...

File Dialog Object

The FileDialog object is a very useful Microsoft Office Object. Believe it or not, you've already seen the FileDialog object in action. Almost all Microsoft Windows applications use some variation of it. In a nutshell, the FileDialog object allows you to display and manage standard Open and Save file dialog windows. An example of the Windows Open dialog window is seen in Figure 11.7. A Microsoft Windows Open dialog window. To work with the FileDialog object, you also need to work with the...

Connecting to a Database

Before you and ADO can work with data in a data source, you must first establish a connection using the Connection object. To declare variables of ADO object type, use the ADODB library name followed by a period and a specific ADO object type such as Connection. An example of declaring an ADO object variable of Connection type is seen here. Dim myConnection As ADODB.Connection If you're using ADO to connect to your current Microsoft Access application, you can use the CurrentProject object's...