Now I remember why I dislike ADOX so much! :-(
On testing, I can't get my original suggestion to work either. But the
following seems to work. After running this code, when I look at the table
in design view, the first field ("ANonNullableColumn") has the Required
property set, the second field ("ANullableColumn") doesn't.
Public Sub TestNullable()
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Dim col1 As ADOX.Column
Dim col2 As ADOX.Column
Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection
Set tbl = cat.Tables("tblTest")
Set col1 = New ADOX.Column
With col1
.Name = "ANonNullableColumn"
.Type = adInteger
End With
tbl.Columns.Append col1
Set col2 = New ADOX.Column
With col2
.Name = "ANullableColumn"
.Type = adInteger
.Attributes = adColNullable '<------------------------------------NB
End With
tbl.Columns.Append col2
End Sub