PDA

Click to See Complete Forum and Search --> : How to create a field type


ingrid
Nov 15th, 1999, 08:16 PM
Hello dear VB programmers,

I made the following line
With tdfNew
.Fields.Append .CreateField("Plant", dbText)
End With

How can I create a primary key in this line.
Where can I find other types (Autonumber / YesNO / etc) in the help of VB5

Nice greetings

Ingrid.

smalig
Nov 15th, 1999, 08:40 PM
Try it:

------------------
Dim Idx As Index

Set Idx = tdfNew.CreateIndex("PrimaryKey")

With Idx
.Primary = True
.Required = True
.Ignorenulls = False
.Fields.Append .CreateField("Field1")
End With

tdfNew.Indexes.Append Idx
tdfNew.Indexes.Refresh

------------------
smalig
smalig@hotmail.com
smalig.tripod.com (http://smalig.tripod.com)