See Also
Applies To
Forms collection, Controls collection, Fields collection , Indexes collection , TableDefs collection .
Description
Forms collection
specifies the number of loaded forms.
Controls collection
specifies the number of controls on a form, including menus and menu items.
Fields, Indexes, TableDefs collections
specifies the number of objects in the collection.
Not available at design time; read-only at run time.
Usage
Forms.Count
[form.]Controls.Count
database.TableDefs.Count
{ tabledef | recordset}.Fields.Count
{ table | tabledef}.Indexes.Count
Remarks
You can use this property in a For...Next For example, the following code would move all controls on a form one-half inch to the right (ScaleMode = 0):
For I = 0 To Form1.Count - 1
Form1.Controls(I).Left = Form1.Controls(I).Left + 720
Next I
You can also use this kind of structure to quickly enable or disable all controls on a form.
When used with the If TypeOf
Data Type
Integer
Help:
Count Function (SQL Only)
RecordCount Property
Programmer's Guide:
Chapter 8, "Objects and Instances"