On Fri, 11 Jun 2004 14:30:01 -0700, ari <ar*@discussion s.microsoft.com > wrote:
¤ 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 AccessReportDoc uments As dao.Documents
Dim AccessReport As dao.Document
AccessDB = JetEngine.OpenD atabase("e:\My Documents\db1.m db")
AccessReportDoc uments = AccessDB.Contai ners("Reports") .Documents
For Each AccessReport In AccessReportDoc uments
Console.WriteLi ne(AccessReport .Name)
Next AccessReport
AccessDB.Close( )
AccessDB = Nothing
AccessReportDoc uments = 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 ~~~
pc******@amerit ech.net
Microsoft MVP (Visual Basic)