Critics of Microsoft’s Visual Basic for Applications (VBA) often contend that it is too “simple” a programming language, particularly when stacked up against C++ and C#.
But Andrew Couch, a Microsoft MVP (“Most Valuable Professional”) with extensive experience in Access and VBA programming, is quick to differ with those critics in his new book. “Quite to the contrary,” he states, “the big advantage of VBA is that this simplicity leads to more easily maintainable and reliable code, particularly when developed by people with a more business-focused orientation to programming.”
He concedes that “[i]n the .NET world, the conflict between using VB.NET, which originates from VBA, and C# continues, because even though the objects being manipulated are now common, there are subtle differences between the languages, which means that developers moving from VBA to C# can often feel that they are being led out of their comfort zone, especially when they need to continue to use VBA for other applications.”
He also notes that Access has gotten bad raps regarding “poor performance applications,” IT department support “nightmares,” network bandwidth consumption and low corporate trust for handling “mission-critical applications.”
Couch’s new book asserts that these problems stem more from the “successes” of Access and VBA, as well as “those lacking some direction on how to effectively develop applications.” For example, “[t]he big problem with Access is that the underlying database engine is extremely efficient and can compensate for a design that normally would not scale.” Therefore, “the existing application design techniques for searching and displaying data [may] need to be revised,” if Access database data is converted to be located in Microsoft SQL Server, Microsoft SQL Azure or Microsoft SharePoint.
The author’s two goals for this book are (1) helping create “a better informed community of developers” and (2) showing “how to better develop applications with VBA.”
Couch also has aimed his work toward two types of readers. The first are those who have worked with Microsoft Access and developed applications and now want to “more fully develop applications with a deeper understanding of what it means to program with VBA.” The second are experienced VBA programmers who want to explore “the more advanced aspects of VBA programming.”
Special attention is paid in the book to helping readers who are “developing with both SQL Server and cloud computing.”
So this not a beginner’s book. Yet it is written well enough and provides enough illustrations and steps that newcomers to Access and VBA may want to add it to their libraries, particularly after reading Microsoft Access 2010 Inside Out, written by Jeff Conrad and John Viescas.
Couch’s 700-page VBA book is divided into seven parts and 18 chapters:
Part 1: VBA Environment and Language
- Chapter 1: Using the VBA Editor and Debugging Code
- Chapter 2: Understanding the VBA Language Structure
- Chapter 3: Understanding the VBA Language Features
Part 2: Access Object Model and Data Access Objects (DAO)
- Chapter 4: Applying the Access Object Model
- Chapter 5: Understanding the Data Access Chapter Model
Part 3: Working with Forms and Reports
- Chapter 6: Using Forms and Events
- Chapter 7: Using Form Controls and Events
- Chapter 8: Creating Reports and Events
Part 4: Advanced Programming with VBA Classes
- Chapter 9: Adding Functionality with Classes
- Chapter 10: Using Classes and Events
- Chapter 11: Using Classes and Forms
Part 5: External Data and Office Integration
- Chapter 12: Linking Access Tables
- Chapter 13: Integrating Microsoft Office
Part 6: SQL Server and SQL Azure
- Chapter 14: Using SQL Server
- Chapter 15: Upsizing Access to SQL Server
- Chapter 16: Using SQL Azure
Part 7: Application Design
- Chapter 17: Building Applications
- Chapter 18: Using ADO and ADOX
The book also has a well-detailed, 25-page index.
Couch emphasizes that “[a] significant strength of VBA is that it is universal to the Microsoft Office suite of programs; all the techniques we describe in this book can be applied to varying degrees within the other Office products.”
He maintains: “To successfully work with VBA, you need an understanding of the language, the programming environment, and the objects that are manipulated by the code.”
His book can get you going on that track, starting with a detailed look at the VBA Editor, which “is more than a simple editing tool for writing programming code. It is an environment in which you can test, debug, and develop your programs.”
The VBA editor, he points out, allows you to change application code on the fly, while the code’s execution is paused. You also can switch to the Access 2010 application window while the code is paused. There, you can “create a query, run the query, copy the SQL to the clipboard, and then swap back to the programming environment to paste the SQL into your code. It is this flexibility during the development cycle that makes developing applications with VBA a productive and exhilarating experience.”
The book provides a link to sample database files. Meanwhile, the code examples are designed to run with Access 2010 32-bit.
Most examples also can be used with Access 2010 64-bit. But there are some required changes and exceptions noted in the front of the book.
Just in case you don’t want to lug around a paperback copy of Microsoft Access 2010 VBA Programming Inside Out, it is available on Kindle, too. But the paperback edition also comes with access to a fully searchable Web edition, through Safari Books Online.
– Si Dunn