Question : how to get MS Access query "description" text field via VBA

In MS Access databases, queries have a "description" field (text) that you can get at in design mode. Using VBA (~VB6) I can get at just about everything having to do with an Access query (the name of the query, the SQL statement, etc) except the one thing I WANT to get at which is the description text. Does anyone know how to do that?

Thanks,

Answer : how to get MS Access query "description" text field via VBA

What version of Access are you using?  I am working with 2002, and that property is exposed from the QueryDef.Properties collection.  Previous versions may not have that property available.

You can also try this.  It will print the names and properties of all queries in the database:

Public Sub CatalogQueries()
Dim qdf As DAO.QueryDef
Dim propdef As DAO.Property
Dim db As DAO.Database

On Error Resume Next
Set db = CurrentDb
For Each qdf In db.QueryDefs
    Debug.Print "Query -- " & qdf.Name
    For Each propdef In qdf.Properties
        Debug.Print "    Property " & Nz(propdef.Name, "No Valid Name") & ":  " & Nz(propdef.Value, "No Value")
    Next
Next

Set db = Nothing

End Sub
Random Solutions  
 
programming4us programming4us