You're beyond the basics, so dive right in and customize, automate, and extend Access—using Visual Basic® for Applications (VBA). This supremely organized reference is packed with hundreds of time-saving solutions, troubleshooting tips, and workarounds. It's all muscle and no fluff. Discover how the experts use VBA to exploit the power of Access—and challenge yourself to new levels of mastery!
Enhance your application with VBA built-in functions and SQL code
Use the Access Object Model to work with data in forms and reports
Manipulate data using SQL, queries, and recordsets with Data Access Objects (DAO)
Create classes for handling form and control events
Connect your Access database to different sources of data
Effectively plan how to upsize an existing Access database to Microsoft SQL Server®
Dynamically update Microsoft Excel® spreadsheets from the database
Migrate your Access database directly to the cloud using SQL Azure™
VBA Environment and Language
Chapter 1 Using the VBA Editor and Debugging Code
Debugging Code on a Form
Creating Modules and Procedures
Debugging Code in a Module
Breakpointing Code
Using the Object Browser and Help System
Summary
Chapter 2 Understanding the VBA Language Structure
VBA Language Settings
Working with Constants and Variables
Functions and Procedures
Control Statements and Program Flow
Summary
Chapter 3 Understanding the VBA Language Features
Using Built-In Functions
Domain Functions
SQL and Embedded Quotes
Objects and Collections
Creating Maintainable Code
VBA and Macros
Error Handling
Summary
Access Object Model and Data Access Objects (DAO)
Chapter 4 Applying the Access Object Model
The Application Object Methods and Properties
The CurrentProject and CurrentData Objects
The DoCmd Object
Manipulating the Forms and Reports Collections
Using the Screen Object
Enhancing the User Interface
Summary
Chapter 5 Understanding the Data Access Object Model
The DAO Model
Working with Databases
Manipulating Data with Recordsets
Working with Queries in Code
Investigating and Documenting Objects
Sample Applications
Summary
Working with Forms and Reports
Chapter 6 Using Forms and Events
Displaying Records
Filtering by Using Controls
Interacting with Records on a Form
Editing and Undo on a Record
Summary
Chapter 7 Using Form Controls and Events
Control Events
Combo Boxes
List Boxes
The TreeView Control
The Tab Control
Summary
Chapter 8 Creating Reports and Events
Report Event Sequences
Report Layout Control
Summary
Advanced Programming with VBA Classes
Chapter 9 Adding Functionality with Classes
Improving the Dynamic Tab Control
Creating a Hierarchy of Classes
Summary
Chapter 10 Using Classes and Events
WithEvents Processing
Abstract and Implementation Classes
Friend Methods
Summary
Chapter 11 Using Classes and Forms
Opening Multiple Instances of a Form
Classes and Binding Forms
ActiveX Controls and Events
Summary
External Data and Office Integration
Chapter 12 Linking Access Tables
Linking Access to Access
Linking to Excel and Text Files
Linking to SQL Server
Linking to SQL Azure
Linking to SharePoint Lists
Linking Access Web Databases
Summary
Chapter 13 Integrating Microsoft Office
Working with Objects and Object Models
Connecting Access to Word
Connecting Access to Excel
Connecting Access to Outlook
Summary
SQL Server and SQL Azure
Chapter 14 Using SQL Server
Introducing SQL Server
Getting Started with the SQL Server Management Studio
Creating Tables and Relationships
Working with Views
Working with Stored Procedures
Introducing T-SQL
Working with Triggers
Working with Transactions
User-Defined Functions
Getting Started with SQL Server Security
Summary
Chapter 15 Upsizing Access to SQL Server
Planning for Upsizing
The Upsizing Wizard and the SQL Server Migration Assistant
Developing with Access and SQL Server
Summary
Chapter 16 Using SQL Azure
Introducing SQL Azure
Migrating SQL Databases
The Data Sync Feature
Planning and Managing Security
Building Multi-Tenanted Applications
SQL Server Migration Assistant and Access to Azure
Summary
Application Design
Chapter 17 Building Applications
Developing Applications
Completing an Application
Deploying Applications
Summary
Chapter 18 Using ADO and ADOX
ActiveX Data Objects
Working with SQL Server
ADOX
Summary
Appendix About the Author
Title:
Microsoft® Access® 2010 VBA Programming Inside Out
Andrew Couch is a Microsoft Access MVP. He has been programming with VBA since it was introduced into the Access product, and uses VBA on a daily basis in commercial applications. As a director and founding member of the UK Access User Group, he has been involved with developers and software companies using VBA. Andrew is also an experienced instructor, and has taught Introductory, Advanced, and VBA programming courses.
Comments about Microsoft Press Microsoft® Access® 2010 VBA Programming Inside Out:
I approached this mighty tome on two levels: that of someone new to VBA programming (I can still remember the steep learning curve I went through...) and my own, as someone with a number of years experience in development. I have to say, it works very well at both levels.
Having written software guides myself, I know how important both content and presentation are - they're the Lennon and McCartney of technical writing. Without content, of course, you have nothing, but if the presentation is insufficiently consistent and attractive, your readers might give up on you. This book pays close attention to these aspects of presentation - the style is consistent throughout, and well explained at the outset. At the risk of over-emphasising this point, I do believe this kind of approach is reassuring for readers, especially those who are taking their first steps into an unfamiliar technology. The language too, is friendly and not at all forbidding - I particularly like the warnings that a section might be a little daunting, and suggestions on where to skip to if you that's the case.
The book is divided into seven sections, covering everything from VBA basics to integration with other office programs and SQL Server. I spent some time on Part 1: VBA Environment and Language (three chapters), as this is the part which a newcomer to VBA would, I think, find most useful. It provides an excellent, thorough introduction but is by no means superficial; in conjunction with the online sample databases, anyone competent with the Access interface would be well-equipped to start making real use of VBA. Part 2: Access Object Model and Data Access objects (DAO) goes deeper and, as the text says, can be skipped if it's too technical for the moment - it's quite possible to work with forms and reports (part 3) without a detailed knowledge of DAO; a bit like being able to drive competently without knowing precisely how a clutch and gears work. Part 3: Working with Forms and Reports gets to the heart of the matter - making forms and reports work harder and perform more efficiently and creatively. This is particularly important if, as is so often the case, the systems you develop will be used by administrators and others who cannot be expected to have detailed knowledge of ICT. Again, the explanations and examples are clear and precise. Incidentally, the "Inside Out" panels, providing tips and extra information throughout the book, are a very helpful device, often explaining why something is not the case, or clearing up some confusion, something technical manuals often leave out.
Part 4: Advanced Programming with VBA Classes makes a very welcome appearance for someone like me, who has never used classes, but always wanted to. It's also a discrete section which can be skipped without affecting your acquisition of the skills you need. Even after a cursory reading, I feel I understand the concept and I look forward to absorbing this aspect of VBA and using it in development.
For someone who has not explored the use of Office programs in conjunction, Part 5: External Data and Office Integration provides a practical introduction to firing up Word (to put the results of a query into a mail merge, for example) and Excel (perhaps to produce charts and graphs based on Access data). I found the section on late vs. early binding and CreateObject vs. New especially useful. I well remember the horizons opening up before me the first time I realised I could `drive' other Office programs from within VBA, and this section illuminates this very well. Including Internet Explorer, which also has an object model, in this section, might have been a useful addition.
Like part 4, Part 6: SQL Server and SQL Azure deals with aspects of development I haven't been involved with. However, I've always know that I'll have to bite the bullet one day, and I can see that this section will stand me in good stead when I do. It starts by clearly explaining what SQL Server is and how its organisation differs from that of a straightforward Access database, with the caveat that it may take some time and effort to grasp fully, and progresses through the different versions available, the tools to help in setting up and manipulating SQL databases and the process of `upsizing' from Access.
Finally, Part 7: Application Design takes the reader through all aspects of the design and development process, including the all-important business of protecting your application from accidental (or even mischievous) access to its design. There are useful sections on providing progress bars to reassure users during lengthy processes, creating custom ribbons and deploying secure versions of your applications.
Andrew Couch has done a lovely job of organising this book into logical sections, enabling the reader either to work their way through it from beginning to end, or to select sections particularly appropriate to them.
8/3/2011
5.0
A timely look at MS Access 2010 VBA
By NMD - Demarque Int
from Essex, UK
About Me Developer
Pros
Concise
Easy to understand
Helpful examples
Well-written
Cons
Best Uses
Expert
Intermediate
Comments about Microsoft Press Microsoft® Access® 2010 VBA Programming Inside Out:
Microsoft Access 2010 VBA Programming Inside Out is a timely released publication. The book helps a developer maintain their grasp of a constantly developing product. For the experienced developer, many time-saving programming pitfalls are highlighted. For those with less MS Access experience, there is a useful review of Error Debugging and VBA programming. This leads to a clear pathway to the integration of MS Access with other Microsoft Office applications. The procedures are well documented with easy to follow concise worked examples. The book proved helpful for this reviewer, an intermediate developer wishing to explore the capabilities and limitations of some of the new developments in MS Access 2010 when connected to SQL Server hosted data. The author brings us right up to date with a wealth of experience and knowledge. The book showcases the upsizing of MS Access databases to SQL Server, the integration of MS Access 2010 with SQL Azure as well as more recent Cloud developments. I would recommend this book to any developer wishing to stay abreast of MS Access programming development.
8/2/2011
5.0
All facts and no waffle
By John
from Norwich, UK
About Me Developer
Pros
Concise
Helpful examples
Cons
Best Uses
Expert
Intermediate
Comments about Microsoft Press Microsoft® Access® 2010 VBA Programming Inside Out:
This book provides exactly what the Product Description sets out. It covers a huge amount of ground in a very concise way. You will need some experience of using Access before tackling this book and you will need to work through the sample code in a methodical way - but put in the effort and the book will deliver knowledge that would take several weeks of training courses to deliver - at a fraction of the price! Even people who have been programming in VBA for many years are likely to learn something new (I certainly did), especially as the book provides an introduction to Azure.