Databases Reference
In-Depth Information
Integer
dbInteger
3
L ong
dbLong
4
Currency
dbCurrency
5
S ingle
dbSingle
6
Double
dbDouble
7
D ate/Time
dbDate
8
Text
dbText
10
L ong Binary (OLE Object)
dbLongBinary
11
Memo
dbMemo
12
G UID
dbGUID
15
15.3.1.1 Note
To remove a field from a TableDef object, use the Delete method.
Field objects have a variety of properties, among which are:
AllowZeroLength
True if a zero-length value is valid for a text or memo field. (Setting this property
for a nontext field generates an error.)
DefaultValue
Sets or returns the default value of a Field object.
Required
True indicates that a null value is not allowed.
ValidationRule and ValidationText
Used for validation of field values. (See the following example.)
The procedure in Example 15-2 creates a new table named NewTable , creates a new field
named NewField , sets certain properties of the field and appends it to the Fields
collection, and then appends the new table to the TableDefs collection.
Example 15-2. A CreateTableDef method example
Sub exaCreateTable( )
Dim db As DATABASE
Dim tblNew As TableDef
Dim fld As Field
Set db = CurrentDb
Search WWH ::




Custom Search