https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/931407&feed=atom&action=history
Microsoft KB Archive/931407 - Revision history
2024-03-29T13:21:03Z
Revision history for this page on the wiki
MediaWiki 1.39.3
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/931407&diff=227344&oldid=prev
3155ffGd: importing KB archive
2020-07-18T17:36:14Z
<p>importing KB archive</p>
<p><b>New page</b></p><div><div id="nsbanner"><br />
<br />
<div id="bannerrow1"><br />
<br />
{|<br />
| Knowledge Base<br />
|<br />
|}<br />
<br />
<br />
</div><br />
<div id="TitleRow"><br />
<br />
= <span id="KB931407"></span>Error message when you run a macro that calls a VBA function in an Access 2007 database: &quot;Action Failed Error Number: 2950&quot; =<br />
<br />
<br />
</div><br />
<br />
</div><br />
<div id="nstext" valign="BOTTOM"><br />
<br />
Article ID: 931407<br />
<br />
Article Last Modified on 10/15/2007<br />
<br />
<br />
-----<br />
<br />
APPLIES TO<br /><br />
<br /><br />
<br />
* Microsoft Office Access 2007<br />
<br />
<br />
-----<br />
<br />
<div class="symptoms_section"><br />
<br />
== SYMPTOMS ==<br />
<br />
When you run a macro that calls a Microsoft Visual Basic for Applications (VBA) function in a Microsoft Office Access 2007 database, you receive the following error message:<br />
<div class="errormessage"><br />
<br />
Action Failed<br /><br />
<br /><br />
Macro Name:<br /><br />
<code>MacroName</code><br /><br />
<br /><br />
Condition:<br /><br />
<code>Condition</code><br /><br />
<br /><br />
Macro Name:<br /><br />
RunCode<br /><br />
<br /><br />
Arguments:<br /><br />
<code>Arguments</code><br /><br />
<br /><br />
Error Number:<br /><br />
2950<br />
<br />
</div><br />
<br />
</div><br />
<div class="cause_section"><br />
<br />
== CAUSE ==<br />
<br />
This issue occurs if the database is not trusted by Access 2007. By default, Access 2007 opens databases that are not trusted in Disabled mode. In Disabled mode, executable content is disabled.<br />
<br />
</div><br />
<div class="resolution_section"><br />
<br />
== RESOLUTION ==<br />
<br />
If you trust the author of the Access 2007 database, and if you want to enable the database, use one of the following methods.<br />
=== Method 1: Enable the database for the current session ===<br />
<br />
When you use this method, Access 2007 enables the database until you close the database. To enable the database for the current session, follow these steps:<br />
# On the Message Bar, click '''Options'''.<br />
# In the '''Microsoft Office Security Options''' dialog box, click '''Enable this content''', and then click '''OK'''.<br />
<br />
'''Note''' You must repeat these steps every time that you open the database.<br />
=== Method 2: Move the database to a trusted location ===<br />
<br />
To do this, follow these steps:<br />
<ol><br />
<li>Determine trusted locations to which you can move the database. To do this, follow these steps:<br />
<ol style="list-style-type: lower-alpha;"><br />
<li>Click the '''Microsoft Office Button''', and then click '''Access Options'''.</li><br />
<li>Click '''Trust Center''', and then click '''Trust Center Settings''' under '''Microsoft Office Access Trust Center'''.</li><br />
<li>Click '''Trusted Locations''', and then use one of the following procedures:<br />
<ul><br />
<li>Note the paths of the trusted locations that are listed.</li><br />
<li>Add a new trusted location. To do this, click '''Add new location''', and then specify the path of the location that you want to add.</li></ul><br />
</li></ol><br />
</li><br />
<li>Move the Access 2007 database to the trusted location that you want.</li></ol><br />
<br />
<br />
</div><br />
<div class="moreinformation_section"><br />
<br />
== MORE INFORMATION ==<br />
<br />
You can use an AutoExec macro to test whether a database is trusted when you open the database. Additionally, the macro can open a form that displays a customized message to users if the database is not trusted. This message lets users know that the database must be enabled or trusted for the code to run successfully.<br /><br />
<br /><br />
To create the AutoExec macro and the form, follow these steps:<br />
<ol><br />
<li>Create a new form in Design view.</li><br />
<li>Add a text box or a label to the form, and then type the information that you want to display to the user.</li><br />
<li>Save and then close the form.</li><br />
<li>Create a macro, and then name the macro AutoExec.</li><br />
<li>Show the '''Conditions''' column.</li><br />
<li>Type the following line in the '''Conditions''' column:<br />
<div class="indent"><br />
<br />
<p><span class="kbd userinput"> CurrentProject.IsTrusted = False </span></p><br />
<br />
</div></li><br />
<li>In the '''Actions''' column, click '''OpenForm'''.</li><br />
<li>In the '''Form Name''' box under '''Action Arguments''', click the form that you created in step 1.</li><br />
<li>Save and then close the macro.</li></ol><br />
<br />
When the database opens, the AutoExec macro starts and then tests the '''IsTrusted''' condition. If the database is not trusted by Access 2007, the macro opens the form that you specified in the &quot;OpenForm&quot; action of the macro.<br />
<br />
</div><br />
<div class="references_section"><br />
<br />
== REFERENCES ==<br />
<br />
For more information, see the Help files in Access 2007. To do this, click '''Microsoft Office Access Help''', type <span class="kbd userinput"> how database objects behave when trusted and untrusted</span> in the '''Type words to search for''' box, and then click '''Search'''.<br />
<br />
</div><br />
<br /><br />
<br />
Additional query words: ac2007 acc2007 access2007<br />
<br />
Keywords: kberrmsg kbtshoot kbprb kbexpertiseinter KB931407<br />
<br />
<div class="footer"><br />
<br />
<br /><br />
<br />
<br />
-----<br />
<br />
[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]<br />
<br />
<span>© Microsoft Corporation. All rights reserved.</span><br />
<br />
<br />
</div><br />
<br />
</div></div>
3155ffGd