7
votes

Where can I find a native list of MS Access properties available through:

 CurrentDb.Properties("Property_Name_Here")

For example, I know;

  • AppTitle is available to access the title of the application
  • AppIcon is available to access the path of the icon used for the application

For different versions I am sure there are different properties. Are there lists by version? So for example, MS Access 2003 has these properties... while MS Access 2007 has these properties... and so on.

4
To supplement these answers, it appears that some property types are returned as a DAO.DataTypeEnum and others as VBA.vbVarType, depending on the parent object type. This is relevant to Ballamber's answer, for example. See: stackoverflow.com/questions/27682177/… - Ben McIntyre

4 Answers

10
votes

I don't believe there is a list anywhere. Tho, the Properties property is a collection. You can iterate over them and get all the ones associated. You'd have to do this all the versions of MS Access you're interested in. To further expound, almost all the internal objects, e.g. tables, fields, queries, etc. have properties. The field properties are particularly useful as you can assign how MS Access links and displays the field to the user.

7
votes

There is a properties collection:

Sub ListProps()
    For i = 0 To CurrentDb.Properties.Count - 1
        Debug.Print CurrentDb.Properties(i).Name
    Next
End Sub
3
votes

It's hard to find that kind of info.

I did find a link here for Access-defined DAO properties

1
votes

Would this be ok? :)

Option Compare Database
Option Explicit

Private Sub btnShowDbProps_Click()
On Error GoTo Err_btnShowDbProps_Click

  Dim prp As DAO.Property
  Dim dbs As Database
  Dim strProps As String

  Set dbs = CurrentDb

  For Each prp In dbs.Properties
    Dim propval As String
    propval = "<not defined>"

    On Error Resume Next
    propval = CStr(prp.value)

    If propval = vbNullString Then propval = "<empty>"

    strProps = strProps & prp.Name & "=" & propval & " (" & PropertyType(prp.Type) & ")" & vbNewLine
    Debug.Print strProps
  Next

  MsgBox strProps

Exit_btnShowDbProps_Click:
    Exit Sub

Err_btnShowDbProps_Click:
    MsgBox Err.Description
    Resume Exit_btnShowDbProps_Click

End Sub

Function PropertyType(intType As Integer) As String

   Select Case intType
      Case dbBoolean
         PropertyType = "dbBoolean"
      Case dbByte
         PropertyType = "dbByte"
      Case dbInteger
         PropertyType = "dbInteger"
      Case dbLong
         PropertyType = "dbLong"
      Case dbCurrency
         PropertyType = "dbCurrency"
      Case dbSingle
         PropertyType = "dbSingle"
      Case dbDouble
         PropertyType = "dbDouble"
      Case dbDate
         PropertyType = "dbDate"
      Case dbText
         PropertyType = "dbText"
      Case dbLongBinary
         PropertyType = "dbLongBinary"
      Case dbMemo
         PropertyType = "dbMemo"
      Case dbGUID
         PropertyType = "dbGUID"
      Case Else
         PropertyType = "Unknown:" & intType
   End Select

End Function