Microsoft Access for Windows® 95 introduced many new features for application development. Microsoft Access 97 introduces additional new features, as well as enhancements to existing features. The following sections highlight new features introduced in both versions.
See Also For more detailed information on new features in Microsoft Access, search the Help index for “what’s new.”
Note If you have applications that were created with Microsoft Access 95 or earlier, you’ll need to consider several important changes that affect your existing code and database objects. For more information, search the Help index for “converting databases.”
Visual Basic for Applications replaces Access Basic, which was used in versions 2.0 and earlier, as the programming language for Microsoft Access. This is the same language you use to program in Microsoft Word, Microsoft Excel, and Microsoft Project, as well as the same language found in Microsoft Visual Basic.
Object-Oriented Language Framework You can now declare procedures and variables as Public in form and report modules, making them available to other modules in your application. In Microsoft Access 97, you can also use class modules to create custom objects and define your own methods and properties for them. See Chapter 2, “Introducing Visual Basic” and Chapter 4, “Working with Variables, Data Types, and Constants.”
Object Creation Syntax For creating new objects, Visual Basic adds the New keyword. Using the New keyword, you can open more than one instance of the same form at a time. In Microsoft Access 97, you can also use the New keyword to create a new instance of a Visual Basic class. See Chapter 5, “Working with Objects and Collections in Visual Basic.”
Flexible Arguments for Procedures Using the Optional keyword, you can declare a procedure with optional arguments. Or, using the ParamArray keyword, you can use a variable number of arguments. Also, when calling a procedure, you can specify arguments by name. This makes your code more readable and allows you to pass arguments in any order you like. See Chapter 2, “Introducing Visual Basic.”
Conditional Compilation Using the #If...Then and #End If statements, you can specify code that you want Microsoft Access to include or ignore in your application. This is especially useful as a debugging technique. See Chapter 7, “Debugging Visual Basic Code.”
Faster Performance Microsoft Access includes a new 32-bit version of the Microsoft Jet database engine that is enhanced for improved performance. Because Visual Basic loads only the code you need and performs many operations more quickly than before, your applications load and run faster. In addition, Microsoft Access 97 doesn’t create a form module until you need to add code to it. As a result, your project may have fewer modules to compile, which improves compilation performance and loads your forms more quickly. For information on taking advantage of these improvements and enhancing performance in other ways, see Chapter 13, “Optimizing Your Application.”
Miscellaneous Language Improvements For simpler, more readable code, try using the With and For Each…Next statements. Visual Basic now includes two new data types, Boolean and Byte. Visual Basic also has more powerful user-defined types, which allow you to use the ReDim statement on the arrays they contain and which can now include objects. See Chapter 4, “Working with Variables, Data Types, and Constants” and Chapter 5, “Working with Objects and Collections in Visual Basic.”
The incorporation of Visual Basic for Applications into Microsoft Access brings the following new and improved professional development tools.
Improved Module Window The Module window is easier to use than ever before, and uses color-coded syntax to make your code easier to read. In Microsoft Access 97, features such as automatic statement building and Data Tips make writing code faster and easier. See Chapter 2, “Introducing Visual Basic” and Chapter 7, “Debugging Visual Basic Code.”
Better Debugging Tools The Debug window contains an Immediate pane, where you can type commands and send information; a Watch pane, which you can use to view the value of an expression or a control while your code is running; and a Locals pane, which automatically provides information on the variables in your procedures while they are running. The Debug window can be open even when you aren’t editing a module. See Chapter 7, “Debugging Visual Basic Code.”
Object Browser The Object Browser helps you navigate between the objects in your system and provides you with a complete, easy-to-use reference for all the functions, constants, objects, methods, and properties available to you. See Chapter 5, “Working with Objects and Collections in Visual Basic.”
Setting References Use the References dialog box (Tools menu) to tell Visual Basic which libraries you want to use in your code. In the References dialog box, you can change referenced libraries without setting initialization options or restarting Microsoft Access. In addition, Microsoft Access 97 provides a References collection which contains Reference objects that you can use to set and check references in your code. See Chapter 12, “Using Library Databases and Dynamic-Link Libraries.”
ODBCDirect You can now use ODBCDirect to access Open Database Connectivity (ODBC) data sources directly, by using Data Access Objects (DAO) features to bypass Microsoft Jet. See Chapter 19, “Developing Client/Server Applications.”
The following features, available to users and developers alike, provide straightforward solutions to some of the challenges of creating a database application.
Database Wizard When you need a simple application right away, or just want to see sample tables, forms, and reports to help you plan your application, the Database Wizard can create all the pieces of many common applications for you. See Chapter 1, “Creating an Application.”
Startup Options Using the Startup dialog box (Tools menu), you can quickly specify your application’s startup form, title bar text, icon, menu, and toolbar, without changing any initialization settings. You use this same interface to make customization options unavailable to your users when you deliver your completed application. See Chapter 1, “Creating an Application” and Chapter 15, “Delivering Your Application.”
Lookup Fields While combo boxes and list boxes are a powerful way to provide lookups between tables, they can be difficult to create and manage in your application. If you add Lookup fields to relate data in two tables, however, all your combo and list boxes will look up data for you with no effort at all. See Chapter 3, “Using Forms to Collect, Filter, and Display Information.”
Filter By Form Interface Using Filter By Form, it’s easy to create a “query-by-form” interface for your users to find data. And you can customize the way the built-in filtering works by setting the Filter, OrderBy, and FilterOn properties and by responding to the Filter and ApplyFilter events. See Chapter 3, “Using Forms to Collect, Filter, and Display Information” and Chapter 6, “Responding to Events.”
Programmable Toolbars and Menu Bars Using the new command bars from Microsoft Office, you can create custom toolbars and menus in your application. See Chapter 1, “Creating an Application.”
The following advanced features help make Microsoft Access more powerful and extensible.
Automation Microsoft Access can now act as a component that supports Automation, so that you can control it from another application such as Microsoft Excel or Microsoft Visual Basic. See Chapter 11, “Communicating with Other Applications.”
Report and Keyboard Event Improvements Two new report events, the Page event and the NoData event, help you respond to common report printing problems. The new KeyPreview property makes it easier to process keyboard events on a form. See Chapter 6, “Responding to Events.”
Object Model Improvements For more control over your application and its environment, use the Screen object, new methods of the Application object, and the Err and Error objects. See Chapter 5, “Working with Objects and Collections” and Chapter 8, “Handling Run-Time Errors.”
New ActiveX Controls With ActiveX controls, formerly called OLE controls or custom controls, you can produce more functional applications. ActiveX controls are now integrated with the toolbox and property sheet. See Chapter 16, “Using ActiveX Controls.”
Database Replication If users of your application need to share data, but aren’t always connected to the network, database replication may be for you. With database replication, Microsoft Access automatically synchronizes changes between databases. In Microsoft Access 97, you can choose to replicate only part of your database. This gives you more control over access to your data and makes your replicated applications easier to maintain. See Chapter 20, “Using Replication in Your Application.”
Removing Source Code from Your Application You can prevent users of your application from viewing or changing your code or the design of your forms and reports by saving your application as an MDE file. When you save your application as an MDE file, Microsoft Access removes all source code from a copy of your database. Your code is compiled and continues to run, but it cannot be viewed or updated. See Chapter 14, “Securing Your Application.”
New Internet Features With the new Hyperlink data type, you can include hyperlink addresses in your application. Hyperlinks jump to documents located on the Internet or on an internal Web (intranet), or even to other documents or database objects located on your computer. See Chapter 21, “Developing Applications for the Internet and the World Wide Web.”