28/11/2023 - Gianky ha scritto:
Qualcuno sa come rintracciarla magari con qualche istruzione in VBA?
Bisogna andare a cercare nella collection Properties.
Qui trovi tutto già pronto
https://extramiledata.com/get-the-name-and-description-of-all-ms-access-database-objects/
Siccome non è un codice “segreto” o impossibile da scrivere, non credo ci siano problemi a riportarlo anche qui
Public Sub AllDescriptions()
' This procedure finds the names and descriptions (from the property
' sheet) for all the types of objects in the database. It creates results
' in the Immediate window, like "Form+frmOrdersEdit:Add/edit Orders data",
' where the object type = Form, object name = frmOrdersEdit, and the object
' description = Add/edit Orders data.
' You can copy the results to column A in an Excel workbook that has the
' following formulas to parse the list:
' Object Type =LEFT(A1,SEARCH("+",A1)-1)
' Object Name =RIGHT(LEFT(A1,SEARCH(":",A1)-1),LEN(LEFT(A1,SEARCH(":",A1)-1))-SEARCH("+",A1))
' Object Desc =RIGHT(A1,LEN(A1)-SEARCH(":",A1))
' AllDescriptions() Version 1.0.0
' Copyright © 2009 Extra Mile Data, www.extramiledata.com.
' For questions or issues, please contact [email protected].
' Use (at your own risk) and modify freely as long as proper credit is given.
On Error GoTo Err_AllDescriptions
Dim qdf As QueryDef
Dim tdf As TableDef
Dim obj As AccessObject
Dim varProperty
Dim strType As String
' Queries.
For Each qdf In CurrentDb.QueryDefs
If Left(qdf.Name, 1) <> "~" Then
varProperty = ""
varProperty = qdf.Properties("Description")
Debug.Print "Query" & "+" & qdf.Name & ":" & varProperty
End If
Next qdf
' Tables.
For Each tdf In CurrentDb.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
varProperty = ""
varProperty = tdf.Properties("Description")
' Set the type based on whether or not the definition
' has a connect string, signifying that it is linked.
If Len(tdf.Connect) > 0 Then
strType = "Table Link"
Else
strType = "Table"
End If
Debug.Print strType & "+" & tdf.Name & ":" & varProperty
End If
Next tdf
' Pages.
For Each obj In CurrentProject.AllDataAccessPages
varProperty = ""
varProperty = CurrentDb.Containers("DataAccessPages").Documents(obj.Name).Properties("Description")
Debug.Print "Page" & "+" & obj.Name & ":" & varProperty
Next obj
' Forms.
For Each obj In CurrentProject.AllForms
varProperty = ""
varProperty = CurrentDb.Containers("Forms").Documents(obj.Name).Properties("Description")
Debug.Print "Form" & "+" & obj.Name & ":" & varProperty
Next obj
' Macros.
For Each obj In CurrentProject.AllMacros
varProperty = ""
varProperty = CurrentDb.Containers("Scripts").Documents(obj.Name).Properties("Description")
Debug.Print "Macro" & "+" & obj.Name & ":" & varProperty
Next obj
' Modules.
For Each obj In CurrentProject.AllModules
varProperty = ""
varProperty = CurrentDb.Containers("Modules").Documents(obj.Name).Properties("Description")
Debug.Print "Module" & "+" & obj.Name & ":" & varProperty
Next obj
' Reports.
For Each obj In CurrentProject.AllReports
varProperty = ""
varProperty = CurrentDb.Containers("Reports").Documents(obj.Name).Properties("Description")
Debug.Print "Report" & "+" & obj.Name & ":" & varProperty
Next obj
Exit_AllDescriptions:
On Error Resume Next
Exit Sub
Err_AllDescriptions:
Select Case Err.Number
Case 3270
' There was no description property for this object.
Resume Next
Case Else
MsgBox Err.Number & " " & Err.Description, vbCritical, "AllDescriptions"
Resume Exit_AllDescriptions
End Select
End Sub
Va a guardare anche le pagine di accesso ai dati che hanno avuto vita breve ed ora non sono più supportate.
Forse c'è di meglio quanto a codice però questo è per dare concretezza alla prima riga della mia risposta.
(edit del 29/11/2023: c'erano due If senza <>, errore di sintassi)