Table Object (Professional Edition Only)

See AlsovbobjTableSee              PropertiesvbobjTableProp           MethodsvbobjTableMth

Description

A table is a type of recordset22S7WAF that is a part of a Database and contains data about a particular subject.  A Table object is a logical representation of a physical table.  Like all recordsets, a table has records (rows) and fields (columns).

Remarks

With a data control, you can open a table only by setting the control's RecordSource property to the name of the table.  When the data control loads, it creates a Dynaset based on the table.  Table objects can be used only in the Professional Edition.  You can, however, access the data in a table through the Dynaset created by a data control and represented by its Recordset property.

The Name property of a Table object is not the same as the name of an object variable to which it is assigned.  Unlike forms and controls, the Name property of a Table object is available at run time.

You can declare an object variableZ3R9Q5 as a Table type.  To open a Table with an object variable, use the OpenTable method on a Database.  You can have more than one object variable that refers to the same table, and you can have one or more Dynasets that refer to some or all fields and some or all records in one or more tables.

The default collection of a Table is the Fields collection, and the default property of a Field is the Value property.  You can simplify your code by taking advantage of these defaults.  For example, the following lines of code both set the value of the "PubID" Field in the current record of a Table object:

MyTable.Fields("PubID").Value = 99
MyTable("PubID") = 99

 

Information about the structure of a table, such as the name and field data type of each Field, is stored in a TableDef.