Partager via


CurrentProject.IsTrusted Property (Access)

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

Version Information

Version Added: Access 2007

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: Access 2010 Programmers Reference book cover The Microsoft Access 2010 Programmer’s Reference | About the Contributors

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

CurrentProject Object Members