Hello
After yesterdays success (Only because of HarleyQuinns help thread705-1416367) today has gone pear shape!
Through code I have managed to add text fields and checkbox fields to a seperate database table. The only thing not quite right was the checkbox properties in the table were randomly coming out as text or checkbox, there was no apparent reason why it should work then not work. I called it a day and have just returned to it to try and sort this out. Unfortunately all I am getting now is a run-time error 3190 to many fields defined!
Even though I have tried the update with only one field the message is still the same. I have even tried right from fresh by setting up a new db but I still get the message.
Please can any one shed some light on this. The code I am using is:
Dim db As DAO.Database
Set db = OpenDatabase("c:\db1")
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Set tdf = db.TableDefs("tblField")
Set fld = tdf.CreateField("CheckBoxField", dbBoolean)
tdf.Fields.Append fld
fld.Properties.Append fld.CreateProperty("DisplayControl", dbInteger, CInt(acCheckBox))
db.Close
Set db = Nothing
After yesterdays success (Only because of HarleyQuinns help thread705-1416367) today has gone pear shape!
Through code I have managed to add text fields and checkbox fields to a seperate database table. The only thing not quite right was the checkbox properties in the table were randomly coming out as text or checkbox, there was no apparent reason why it should work then not work. I called it a day and have just returned to it to try and sort this out. Unfortunately all I am getting now is a run-time error 3190 to many fields defined!
Even though I have tried the update with only one field the message is still the same. I have even tried right from fresh by setting up a new db but I still get the message.
Please can any one shed some light on this. The code I am using is:
Dim db As DAO.Database
Set db = OpenDatabase("c:\db1")
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Set tdf = db.TableDefs("tblField")
Set fld = tdf.CreateField("CheckBoxField", dbBoolean)
tdf.Fields.Append fld
fld.Properties.Append fld.CreateProperty("DisplayControl", dbInteger, CInt(acCheckBox))
db.Close
Set db = Nothing