Access 2007-2019
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  

Open Other Programs Seminar

Learn how to work with external file attachments and web pages in Access 

access open other programs seminar shell shellexec shellexecute

Have you ever wanted to build a database to store an unlimited number of documents or other file attachments with each record? Perhaps you'd like to double-click on any of those files and have them automatically open up in the appropriate program? Open a Word document representing the employee's resume, or automatically have an Excel spreadsheet open up for the client's purchase order. Perhaps you'd like to click on a button next to the customer's address and have your web browser open up directly to that address into Google Maps?

This seminar will teach you how to open other programs, documents, and custom web page addresses from inside your Microsoft Access databases. Topics include:

1. How to display external images in Access Forms
2. Build a database to allow unlimited external attachments per customer
Use the SHELL function to open external files of known type
4. How to determine which application to open
5. Use SHELLEXECUTE to open file in default Windows handler app
6. Open a Web page to a custom URL in default browser
7. Load Google Maps to a Specific Address

Click here to watch the first lesson of the Seminar in our Online Theater:


Access Open Other Programs Seminar
Description: Learn how to work with external file attachments and web pages in Access.
Versions: I use Access 2013, however the topics covered should work fine with any version of Access.
Pre-Requisites: This course stands alone, however it is very strongly recommended that you at least know the basics (Access Beginner 1-3 would be a good start).
Running Time: 1 Hour, 19 Minutes
Cost: $59.99 - Order multiple courses to receive a discount up to 50% off


Here's What You'll Learn

We'll start out by building the sample database we'll use in class. This will be a simple customer table, with a related (one-to-many) table to store an unlimited number of attachments per customer. We'll create a centralized Attachments folder and we'll copy some sample files there. You'll learn how to display an external image on a form.

unlimited file attachments per customer

Next you will learn how to double-click on those attachment filenames and have them open up in the program you specify using an event with a little bit of VBA code and the SHELL function. You will learn how to determine what program to use to open the file (TXT files in Notepad, DOCX files in Word, etc.)

SHELL function access

It's nice to be able to specifically control which program you want to open a specific type of file, but sometimes you want Access to just use the default program that's installed in Windows. This is called the "default handler" for that file type. You may not know if they have Adobe Acrobat installed for PDF files, so in that case Windows might open them in Word. In the next lesson we'll learn about the ShellExecute function which can deal with this scenario.

shellexecute function shellexec

Next we'll build a button that we can click on to open the customer's address up directly in Google Maps. This will involve creating a custom URL and launching the default browser. You'll also see how you can open Windows Explorer to browse folders, and how to use a mailto link to send email.

open google maps to customer location

Finally we'll learn some advanced features about the ShellExec subroutine we build in class. We'll see how to set up error handling for when a file cannot be opened, learn about public and private constants, and learn about different arguments for ShellExec like "OPEN" and "PRINT".

If you want to be able to work with external files and programs with Access, this is the perfect seminar for you. You will learn everything mentioned above. You will have access to the full database that we build in class with all of these features. If you have any question whether this seminar is right for you, please feel free to contact me.


Opening Other Programs Outline

00. Intro (7:18)

01. Display External Images (17:29)
Create Customer Table
Setup File Attachments Folder
Copy Images to Folder
Create Customer Form
Display Customer Image on Form
Multiple Attachments Per Customer
Setup Attachments Table
Display File Extensions
Hide Extensions for Known File Types
Attachments Subform

02. Shell Command (23:33)
Command Button Build Event
SHELL Function
System Path Variable
Command Prompt
Determining What Program Opens a File
On Double Click Event
Dealing with Spaces in File Names
Launching Internet Explorer
Command Line Arguments Switches

03. ShellExec Command (20:57)
ShellExecute Function
Create the ShellExec Sub
Code Sample Table and Form
Choose Default File Handler
Open Web Page with ShellExec
Open Google Maps to Customer Address
Build Google Maps URL
Replace Function
Open Folder with Windows Explorer
Sending Email with Mailto

04. ShellExec Command Advanced (7:24)
Private and Public Constants
Error Handling
Other OPEN type arguments

05. Review (2:35)




You may want to read these articles from the 599CD News:


Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn