Set field to allow ZeroLengths using DAO (1 Viewer)

KMAN

New member
Local time
Today, 19:55
Joined
May 2, 2000
Messages
8
Hello all -

I have a table I build with DAO code, then need to add fields and set a Text field to allow Zero-Length strings. I can not figure out how to set the field's property to allow this.

Anybody know how to do this?

Here is the code so far (Dims not included):

Set tdfNew1 = dbs.CreateTableDef("tbl_ImpTemp")
With tdfNew1
.Fields.Append .CreateField("OwnLib", dbText)
.Fields.Append .CreateField("ListTables", dbText)
.Fields.Append .CreateField("ImpTableName", dbText)
.Fields.Append .CreateField("Std", dbBoolean)
.Fields.Append .CreateField("RealTime", dbBoolean)
.Fields.Append .CreateField("DB_ID", dbLong)
.Fields.Append .CreateField("Delete", dbBoolean)
End With
dbs.TableDefs.Append tdfNew1


TIA, KMAN
 

rtg

Registered User.
Local time
Today, 19:55
Joined
Apr 18, 2000
Messages
12
Try the field property AllowZeroLength (see below)

Set fld = tdf.CreateField("FieldName", dbText, 15)

' Allow zero-length strings in field.
fld.AllowZeroLength = True
 

Users who are viewing this thread

Top Bottom