Table of contents
TOC
Collapse the table of content
Expand the table of content

CurrentProject.IsTrusted Property (Access)

office 365 dev account|Last Updated: 1/23/2018
|
4 Contributors

Gets whether or not macros and Visual Basic for Applications (VBA) code have been enabled in the current project. Read-only Boolean.

Syntax

expression. IsTrusted

expression A variable that represents a CurrentProject object.

Example

The following example shows how to use the IsTrusted property in a macro to determine whether the database has been opened with trust enabled. If trust has been enabled, the Visual Basic for Applications (VBA) subroutine Init is called. Otherwise, the use is notified that the database has been opened in disabled mode.

Sample code provided by: The Microsoft Access 2010 Programmer's Reference

If [currentproject].[istrusted] Then
    RunCode
        Function Name =Init()

Else
    MessageBox
        Message The application is opened in disabled mode. Please enable the application for full functionality.
        Beep Yes
        Type None
        Title Disabled Mode Check

End If

About the Contributors

Wrox Press is driven by the Programmer to Programmer philosophy. Wrox books are written by programmers for programmers, and the Wrox brand means authoritative solutions to real-world programming problems.

See also

Concepts

CurrentProject Object

© 2018 Microsoft