DoCmd.SelectObject (Access)

The SelectObject method carries out the SelectObject action in Visual Basic.

You can use the SelectObject method to select a specified database object. The SelectObject action works with any Access object that can receive the focus. This action gives the specified object the focus and shows the object if it's hidden.

SelectObject (ObjectType, ObjectName, InDatabaseWindow)


DoCmd.SelectObject acForm, "Customers", True

Arguments

The following argument is required

ObjectType (AcObjectType) - An AcObjectType constant that specifies the type of object that you want to select.

Here you can find possible values for AcObjectType

Optional arguments

The following arguments are optional

ObjectName (String) - A string expression that's the valid name of an object of the type selected by the ObjectType argument. This is a required argument, unless you specify True (1) for the InNavigationPane argument.

InDatabaseWindow - Boolean