Home  Fees/Services  Access Templates  Tutorials  Access Download  Articles  Search  Contact  Privacy  Links

Visual Basic Tutorial
   
Access Programming Examples
VBA For MS Access

Access Visual Basic Tutorial Visual Basic for Microsoft Access
Microsoft Access Tutorial>Visual Basic Tutorial> Download VBA Example  



VB Age Calculation
VB6 Change Case
Calculate Running Sum
VB Concatenate Records
VB CreateQueryDef
VB6 Database Path
Detail-Master Update
VB Field Validation VBA
VB Field Value New-Old
VB FindFirst Recordset
Get Version Number
VB Global Parameters
Global Variables
Labels as Links
VB Launch Outlook
VB List Box Files List
VB Mail Merge
OutputTo Crosstab
VB Read Email Access
VB Sort Recordset
VB Recordset Filters
VB Reference Form Field
RTF Report Email
VB Select Case
Email From Access
VB Transaction Processing

Visual Basic Function Examples


Visual Basic Tutorial for MS Access

Welcome to our Visual Basic Tutorial for Access Applications home page.  This page provides an overview of our dozens of VBA/VB Script Visual Basic examples.  Web site navigation for our Access VBA coding samples is listed to the right.  The examples range from simple code syntax examples to more complex programming tasks such as APIs and dynamic programming with global variables.

Our goal is to demonstrate the techniques you need to create the best Access databases possible.  At the same time we want to demonstrate our knowledge and skills so that you'll consider our services for your next project or you might hire us for hourly consulting to help you overcome difficult programming tasks on your current project.  Next we have an overview of the program coding examples contained in the main section topics.

Visual Basic Background:  Visual Basic is an extension of the BASIC programming language combined with a graphical user interface used to create and modify programming code.  Visual Basic and the GUI development environment were both developed by Microsoft Corporation.
Access Visual Basic Help
BASIC, Beginner's All-purpose Symbolic Instruction Code, was developed in 1964 by John Kemeny and Thomas Kurtz at Dartmouth College.  The language was one of the first designed to be easy to use and to work in an interactive environment in contrast to batch processing of computer cards prevalent in the 1950's through late 60's.  The author had an opportunity to start using BASIC in 1966 through a timeshare service.

Visual Basic For Applications:  VBA programming, VBscript and VBA scripts provide dynamic aspects to your forms.  We make extensive use of VBA programming in all of our Access relational database applications - we never use macros. Many of our VBA examples can be used in other Microsoft Office projects such as Microsoft Excel and Microsoft Word.  After reviewing these examples visit our case studies where you'll see how we make use of these tools to create Contact Management, Inventory & CRM databases for our clients.

Use of macros to perform these operations should be avoided because of the limited ability to document programming code and to view the entire process within macros.  Also, when performance is an issue, Access visual basic example code will be much faster than macros.

Summary of our Microsoft Access Visual Basic Tutorial & Examples:

Use the right-side links to see full text of Visual Basic examples

Example Summary

Age Calculation One would think that calculating a person's age would be straight forward but with leap years and current days in the month it is more involved than we suspected.  These examples show two methods for determining a person's age.
Change Case Sending out marketing letters?  Often you'll get a database the contains messy data in terms of upper and lower case letters.  Here is the code to convert the names and address to proper case.
Concatenate Records In this example we take a normalized table of data and change it to non-normalized - more like we would see in a spreadsheet.
CreateQueryDef Create stored queries at runtime or create temporary queries to save database space and to make your database less complicated for future maintenance.
Current Database Path Want to know on what drive and directory your database is currently running from.  See these examples to learn how to do it.
Detail-Master Updates Retrieving master records based on the characteristics of the detail record.
Field Validation Ever hear of garbage in garbage out.  Here are some VBA techniques to keep the garbage out.
Field Value New-Old One method to make a form remember an old value after it is changed.  Good for making audit trails.
VBA FindFirst Method You can use the find first command to search through records quickly and manually coordinate two forms.
Get Access Version Number Trying to figure out if your user's Access version is up to date?  The code shows how to determine the Access version number.
VB Global Variables Storing values for the life of a program instance using VB global variables.
Global Parameters Use global variables here, there and everywhere - including passing parameters to queries and forms.
Form Label Link Make your programs come alive and more user friendly by making field labels intelligent links.
Combo Box Files List See the VBA Dir$ function create a drop down list of folders for you users to select from.
Visual Basic  Mail Merge Similar to regular mail merge but all controlled in Access so you don't have to jump to MS Word.
OutputTo Crosstab Bug with Aggregate Functions Microsoft Access bug with global variables & OutputTo using the crosstab query Docmd VB code.
Read Outlook Email Communicate with Microsoft Outlook from Visual Basic.  Read email messages by using the Outlook API.
Sort VB Recordset Using Binary Sort All programmers need to know how to sort a list quickly.  See this Visual Basic recordset example to learn one of the most efficient and easiest VB sort routines: The recursive visual basic sort routine.
VB Recordset Filters Learn how to filter Visual Basic recordset using 3 VBA methods.

Reference Nested Forms and Fields

Take a short cut - reference your forms using the direct access approach.   In this Visual Basic example we reference a deeply nested sub form control.

RTF Report Email Attachment Send an RTF formatted to someone via VBA and your email system.
Select Case Statement Stop using complexly nested if statements and replace them with a Select Case statement.  Select case makes coding and code maintenance a breeze.
Send Email with Access VB In a previous Visual Basic tutorial we learned how to read Outlook emails.  Here we learn the vb code to send emails and attachments.
Transaction Processing Want to make sure your data gets saved or updated.  Use transaction processing methods to guarantee that no data gets left behind.

VB Function Examples

Visual Basic functions from A to Z.


Contact Information

Programming Visual Basic Tutorial

Access Visual Basic/VB/VBA/VBScript/VB6 2007 2003 2000 All Windows Versions