Microsoft KB Archive/209170

= ACC2000: Starting Another Application from a Text Box on a Form =

Article ID: 209170

Article Last Modified on 6/28/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q209170



Novice: Requires knowledge of the user interface on single-user computers.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SUMMARY
This article describes how you can start another application from a text box on a Microsoft Access form.

NOTE: This article explains a technique demonstrated in the sample file, FrmSmp00.mdb. For information about how to obtain this sample file, please see the following article in the Microsoft Knowledge Base:

233324 Microsoft Access 2000 Sample Forms Database Available in Download Center



MORE INFORMATION
You can start another application from a text box on a form by attaching a RunApp action to the AfterUpdate property of the text box. The following example demonstrates how to start an application and load the file whose file name was typed in the text box. This example will start the Microsoft Word for Windows application and load the file from the Word for Windows folder.   Create the following macro:   Macro Name Condition  Action Open Word            RunApp Open Word Action Arguments ---  Command Line: ="c:\Program Files\Microsoft Office\Office\       winword.exe c:\My Documents\" & Forms![formname]![controlname] NOTE: This example assumes the default installation of Word for Windows. Make sure the Command Line above points to the correct drive and folder where winword.exe is located on your computer.  Add a text box to a form. Set the AfterUpdate property of the text box to the Open Word macro. View the form in Form view. Type the name of a file that is in your Word for Windows folder in the text box, including the .doc extension, and then press ENTER. For example, for a file named Test.doc you would type Test.doc .</ol>

<div class="references_section">