¤ Hey all,
¤
¤ Is there a way to access all the reports that have been created for an MS Access application and list them in a datagrid?
¤
You will probably need to use DAO to do this:
Dim JetEngine As New dao.DBEngine
Dim AccessDB As dao.Database
Dim AccessReportDocuments As dao.Documents
Dim AccessReport As dao.Document
AccessDB = JetEngine.OpenDatabase("e:\My Documents\db1.mdb")
AccessReportDocuments = AccessDB.Containers("Reports").Documents
For Each AccessReport In AccessReportDocuments
Console.WriteLine(AccessReport.Name)
Next AccessReport
AccessDB.Close()
AccessDB = Nothing
AccessReportDocuments = Nothing
AccessReport = Nothing
There is an undocumented method that uses SQL with the MSysObjects table but this is a system table
that is typically secured so I can't recommend the solution.
Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)