Invalid Operation when creating table with Yes/No field VBA

N

Nic

I'm getting a type mismatch when I'm trying to add this property to a
dbBoolean field I just created: here is the snippet of code:


Set fld = tbl.CreateField("InMatrix", dbBoolean)
fld.OrdinalPosition = 3
tbl.Fields.Append fld
Set prp = fld.CreateProperty("DisplayControl", dbInteger, acCheckBox)
-> fld.Properties.Append prp

-> I get an invalid operation there.
Here is also my variable declorations:
Dim db As Database, rec As Recordset, rec2 As Recordset, fld As Field, idx
As Index, tbl As TableDef, prp As Property

any ideas?

Thanks!
-Nic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top