User Defined Property : Query « Access « VBA / Excel / Access / Word






User Defined Property

 
Sub exaUserDefinedProperty()
    Dim db As Database
    Dim tbl As TableDef
    Dim prp As Property
    
    Dim str As String
    
    Set db = CurrentDb
    Set tbl = db!BOOKS
    
    Set prp = tbl.CreateProperty("UserProperty", dbText, "Programming DAO is fun.")
    tbl.Properties.Append prp
    str = ""
    For Each prp In tbl.Properties
        Debug.Print prp.Name
        Debug.Print prp.Value
        Debug.Print prp.Type
        Debug.Print prp.Inherited
    Next prp
    Debug.Print tbl.Properties.Count 
    
End Sub

 








Related examples in the same category

1.Creating a Pass-Through Query with ADOX
2.Executing a Pass-Through Query Saved in Access
3.Making Bulk Changes
4.Using a Stored Procedure to Make Bulk Changes to Data in a SQL Server Database
5.Creating a Query Using Code
6.Create Query by using the Database.CreateQueryDef
7.Get the created query name
8.Delete a query
9.Pass parameter to a query
10.Using CreateParameter to delete a company record
11.Execuate query
12.Update a table with QueryDef