Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 209170 - Last Review: June 28, 2004 - Revision: 2.0
ACC2000: Starting Another Application from a Text Box on a Form
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).
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Â
(http://kbalertz.com/Feedback.aspx?kbNumber=233324/EN-US/
)
Microsoft Access 2000 Sample Forms Database Available in Download Center
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.
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.
APPLIES TO
- Microsoft Access 2000 Standard Edition
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate