A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Dbs is a DAO,Database object.
AllQueries is not a property of the DAO Database object, but of Access.CurrentData.
Use the QueryDefs collection of the DAO.Database object.
Private Sub cmdOK_Click()
Dim Qdf As Object
Dim Dbs As Object
Set Dbs = OpenDatabase("D:\Folder\Test.accdb", False, False, ";pwd=" & DatabasePassword & "")
For Each Qdf In Dbs.QueryDefs
Debug.Print Qdf.Name
Next Qdf
End Sub