Retrieves an object from the collection by its Name property.
Applies to objects: Connections, Databases, Fields, Indexes, Properties, QueryDefs, Recordsets, Relations, TableDefs, Workspaces.
[[Set] RetVal = ] object.GetByName(Name) |
The GetByName method syntax has these parts:
Part | Description |
object | Required. An instance of one of the object collections listed above. |
Name | Required. An expression that returns a String value. The name of the object to be retrieved. |
RetVal | Optional. An instance of an object, retrieved from the collection (of Workspace, Connection, Database, TableDef, QueryDef, Relation, Index, Recordset, Field, Property type respectively). |
If the object with the specified objName is missing in the collection, the following error occurs: "The item 'objName' is not found in the collection".
....... |