This documentation is archived and is not being maintained.

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 Added: Access 2007

expression .IsTrusted

expression A variable that represents a CurrentProject object.

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
        Function Name =Init()

        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

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.