CreateField(dbBoolean) Lookup = CheckBox

casey

Registered User.
Local time
Today, 20:57
Joined
Dec 5, 2000
Messages
448
Hello,

Can someone direct me on changing the Lookup property on a boolean field I've created using the CreateField DAO method so the field is a checkbox? I would like it to be a Checkbox type, but do not see a way to do it using DAO. The way I've done it below gives me a 0 or 1. I would prefer it be a checkbox.

.Fields.Append .CreateField("fldInclude", dbBoolean)


Thanks.
 
See if this works for you:

Code:
Private Sub TestThisne()
Dim dbs As Database
Dim tdf As TableDef
Dim p As Property

Set dbs = CurrentDb
Set tdf = dbs.TableDefs("Table1")

tdf.Fields.Append tdf.CreateField("NewField", dbBoolean)
Set p = tdf.Fields("NewField").CreateProperty("DisplayControl", dbInteger, 106)

tdf.Fields("NewField").Properties.Append p

End Sub
 
pdx_man,

Awesome! That works great! Thanks much.
 

Users who are viewing this thread

Back
Top Bottom