Hello,
I am trying to add a field to a table and modify it to:
1. display as combobox
2. set rowSourceType to value list
3. set RowSourceType to 'Value List'
4. set RowSource to "Active" or "Inactive" values
My code does add the field by does not modify it's properties.
Code:
If Not (FieldExists("Status", "tblMytbl")) Then
strToDB = fGetLinkPath("tblMytbl")
Set db = OpenDatabase(strToDB, False, False, ";pwd=xxx")
Set nt = db.TableDefs("tblMytbl")
Set fl = nt.CreateField("Status", dbText)
nt.Fields.Append fl
nt.Fields.Refresh
Set fl = nt.Fields("Status")
Set pr = fl.CreateProperty("DisplayControl", dbText, 111)
fl.Properties.Append pr
'fl.Properties.Append fl.CreateProperty("RowSourceType", "Value List")
'fl.Properties.Append fl.CreateProperty("RowSource", "Active,Inactive")
nt.Fields.Refresh
db.Close
Set db = Nothing
End If
Can you help me ?
Thank you for your help