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

ID: Q209170


The information in this article applies to:

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

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


SUMMARY

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


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.

  1. 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.


  2. Add a text box to a form.


  3. Set the AfterUpdate property of the text box to the Open Word macro.


  4. View the form in Form view.


  5. 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.



REFERENCES

For more information about RunApp action, click Microsoft Access Help on the Help menu, type "RunApp" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Additional query words:


Keywords          : kbdta FmsEvnt 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: June 10, 1999