Application.UserControl property (Access)

Use the UserControl property to determine whether the current Microsoft Access application was started by the user or by another application with Automation, formerly called OLE Automation. Read/write Boolean.

Syntax

expression.UserControl

expression A variable that represents an Application object.

Remarks

The UserControl property uses the following settings.

Setting Description
True The current application was started by the user.
False The current application was started by another application with Automation.

This property is read-only in all views when a user starts the Access application. If Microsoft Access is started by OLE Automation, the UserControl property can be set in Visual Basic.

When an application is launched by the user, the Visible and UserControl properties of the Application object are both set to True. When the UserControl property is set to True, it isn't possible to set the Visible property of the object to False.

When an Application object is created by using Automation, the Visible and UserControl properties of the object are both set to False.

Example

The following example displays a message indicating whether Access was started by the user.

MsgBox "The user started Access:  " & Application.UserControl

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.