Hi folks,
I'm using Access 2010 on a Win7 Pro box.
I want to append a checkbox field to an existing table using VBA.
I have appended the field to the table, but it shows basically as text with the number 0 in the field. I have other checkboxes in the table which was originally created in design mode. I've scoured thru Google attempting to figure out how to convert the field to a checkbox. But I've come up short.
The code I'm using to append the field is as follows:
When I execute this sub, the field is appended but I get RunTime 3265: Item not found in this collection, at the f.Properties(25) = "Yes/No" lineCode:Sub AddTableFields(who As String) Dim db As DAO.Database Dim t As DAO.TableDef Dim f As DAO.Field Set db = CurrentDb Set t = db.TableDefs("InventoryControl") Set f = t.CreateField(who, dbBoolean) t.Fields.Append f f.Properties(25) = "Yes/No" 'Format property: these two properties I got from querying an existing checkbox in the table. f.Properties(26) = 106 'Display Control property Set f = Nothing Set t = Nothing Set db = Nothing End Sub
Any suggestions would be appreciated.
Thanks,
Vic