Home » Computers » Software

Access VBA Handling Errors and Debugging Code

Feb 25, 2008
Effective databases can be created using Microsoft Access. However, if more complex databases are required you must write code using a programming environment called Microsoft Visual Basic for Applications (VBA). By using VBA code, it is possible to overcome the limitations of using macros. A typical Access VBA course for Windows will begin with an introduction to programming in Microsoft Access. It will then move on to cover the use of procedures, functions, objects and expressions, how to work with recordsets and how to control program execution.

Learning the principles of error handling is another particularly important goal for students of Access VBA. A major difference between an amateur and a professionally developed Microsoft Access application is its' ability to deal with problems. Access implements VBA error handling at procedure level. By adding VBA error handling code to your MS Access applications, it is possible to prevent crashes and error messages.

In simple terms, when programmers write code they should be able to anticipate as many problems as possible and attempt to deal with these problems early on. This means coding for error conditions that may arise when your database is running.

There are three main types of problems:
Syntax or user data entry errors arise from the inclusion of mistyped words or incorrect expressions in your code.
Run-time errors are problems faced by users when interacting with your database because the programming environment cannot correctly execute a program statement.
Logic errors are undeclared errors that prevent your code from compiling. These tend to be vague and difficult to fix.

Debugging is another important skill for a developer, especially as code gets more complex. MS Access has been designed to include powerful debugging tools which do not work on built-in macros. To debug code you need to run your code line by line to see what is happening. The next step is to construct a subroutine which calls the function. You need to set a breakpoint inside the function which is a selected line of code that, once reached, will cause your program to become suspended. Then you can use the VBA debugging environment to view the status of your program, step through each successive line of code, continue or halt execution of the code. Other debugging tools include the immediate window and the watch window.

By attending an Access VBA course, it is possible for you to master these and other concepts and ultimately, help you to build more complex databases.
About the Author
Author is a freelance copywriter. For more information on access vba courses, please visit http://www.microsofttraining.net
Rating:
Please Rate:
(Average: Not rated)
Views: 165
Print Email Report Share
Article Categories
    • Artists
    • Gambling
    • Humanities
    • Humor
    • Movies
    • Music
    • Photography
    • Tattoos
    • Television
    • Classic Cars
    • Motorcycles
    • Recreational Vehicles
    • SUVs
    • Trucks
    • Vans
    • Branding
    • Business Opportunities
    • Careers and Jobs
    • Corporate
    • Customer Service
    • Direct Mail
    • Entrepreneurship
    • Ethics
    • Financing
    • Franchising
    • Home-Based Business
    • Human Resources
    • Import and Export
    • Leadership
    • Management
    • Market Research
    • Marketing and Advertising
    • Negotiation
    • Network Marketing
    • Networking
    • Organizational
    • Presentation
    • Project Management
    • Public Relations
    • Small Business
    • Strategic Planning
    • Team Building
    • Telemarketing
    • Training
    • Ask an Expert
    • College and University
    • Home Schooling
    • K-12
    • Languages
    • Online Education
    • Psychology
    • Accounting
    • Credit
    • Currency Trading
    • Debt Consolidation
    • Insurance
    • Investing
    • Leasing
    • Loans
    • Mortgage
    • Mutual Funds
    • Personal Finance
    • Stock Market
    • Structured Settlements
    • Taxes
    • Wealth Building
    • Coffee
    • Cooking
    • Gourmet
    • Recipes
    • Wine and Spirits
    • Acne
    • Aerobics
    • Alternative Medicine
    • Beauty
    • Cancer
    • Cosmetics
    • Depression
    • Diabetes
    • Diseases and Conditions
    • Fitness Equipment
    • Fitness
    • Hair Loss
    • Heart Disease
    • Medicine
    • Men's Health
    • Muscle Building
    • Nutrition
    • Skin Care
    • Supplements and Vitamins
    • Weight Loss
    • Women's Health
    • Yoga
    • Arts and Crafts
    • Babies
    • Collecting
    • Elderly Care
    • Genealogy
    • Hobbies
    • Parenting
    • Pets
    • Pregnancy
    • Woodworking
    • Feng Shui
    • Gardening
    • Home Appliances
    • Home Security
    • Interior Design
    • Landscaping
    • Affiliate Programs
    • Article Marketing
    • Auctions
    • Audio
    • Banner Advertising
    • Blogging
    • Broadband
    • Domain Names
    • E-Books
    • E-Commerce
    • Email Marketing
    • Ezines and Newsletters
    • Forums
    • Internet Marketing
    • Link Popularity
    • Pay-Per-Click
    • Podcasting
    • RSS
    • Search Engine Marketing
    • Search Engine Optimization
    • Security
    • Social Media
    • Spam
    • Video
    • Viral Marketing
    • Web Design
    • Web Development
    • Web Hosting
    • Copyright
    • Cyber Law
    • Intellectual Property
    • National, State, Local
    • Patents
    • Regulatory Compliance
    • Trademarks
    • Buying
    • Selling
    • Baseball
    • Basketball
    • Boating
    • Cycling
    • Extreme Sports
    • Fishing
    • Football
    • Golf
    • Hockey
    • Hunting
    • Martial Arts
    • Running
    • Scuba Diving
    • Soccer
    • Swimming
    • Tennis
    • Dating
    • Divorce
    • Marriage
    • Weddings
    • Astrology
    • Buddhism
    • Christianity
    • Faith
    • Hinduism
    • Islam
    • Judaism
    • Meditation
    • Metaphysical
    • New Age
    • Cable and Satellite TV
    • Cell Phones
    • Communication
    • Gadgets and Gizmos
    • GPS
    • Satellite Radio
    • Video Conferencing
    • VoIP
    • Addictions
    • Coaching
    • Goal Setting
    • Motivational
    • Stress Management
    • Time Management
    • Clothing
    • Electronics
    • Fashion
    • Gifts
    • Jewelry
    • Causes and Organizations
    • Environment
    • History
    • Holidays
    • Men's Issues
    • Nature
    • Philosophy
    • Politics
    • Women's Issues
    • World Affairs
    • Air Travel
    • Camping
    • Cruises
    • Destinations
    • Outdoors
    • Article Writing
    • Book Reviews
    • Copywriting
    • Fiction
    • Non-Fiction
    • Poetry
    • Quotes
    • Screenplay
    • Tools and Resources