Object Dependencies in an ADP application

  • Thread starter Thread starter eagleofjade
  • Start date Start date
E

eagleofjade

I need to get a list of the recordsources of all the reports in an ADP
database application. In a regular Access database, I could use the
following code to derive the recordsources from reports in a database,
but it does not work with an ADP.

Dim db As Database, doc As Document, con As Container
Set db = DBEngine.Workspaces(0).Databases(0)
Set con = db.Containers("Reports")
Application.Echo False
For i = 0 To con.Documents.Count - 1
Set doc = con.Documents(i)
Debug.Print "Report Name: " & doc.Name
DoCmd.OpenReport doc.Name, A_DESIGN
Debug.Print "RecordSource: " &
Reports(doc.Name).Recordsource
Debug.Print
DoCmd.Close A_REPORT, doc.Name
Next i
Application.Echo True


Does anyone know how to go about doing this same task with an ADP
application? Also, if there are any utilities out there that would let
me interrogate an ADP application I'd love to know of them. I have
used Object Dependency Browser from AADconsulting in the past, but it
doesn't seem to work with ADP. I also downloaded a trial version of
Total Access Detective but it too, does not seem to work with ADP
applications.

Any help would be appreciated.
Craig
 
Craig,

I changed your code a little and this worked. There may be better ways but
this could get you started.


Dim i As Integer
Dim s As String
Application.Echo False
For i = 0 To CurrentProject.AllReports.Count

s = CurrentProject.AllReports.Item(i).Name
Debug.Print "Report Name: " & s
DoCmd.OpenReport s, A_DESIGN
Debug.Print "RecordSource: " & Reports(s).RecordSource
Debug.Print
DoCmd.Close A_REPORT, s
Next i
Application.Echo True



Bill

I need to get a list of the recordsources of all the reports in an ADP
database application. In a regular Access database, I could use the
following code to derive the recordsources from reports in a database,
but it does not work with an ADP.

Dim db As Database, doc As Document, con As Container
Set db = DBEngine.Workspaces(0).Databases(0)
Set con = db.Containers("Reports")
Application.Echo False
For i = 0 To con.Documents.Count - 1
Set doc = con.Documents(i)
Debug.Print "Report Name: " & doc.Name
DoCmd.OpenReport doc.Name, A_DESIGN
Debug.Print "RecordSource: " &
Reports(doc.Name).Recordsource
Debug.Print
DoCmd.Close A_REPORT, doc.Name
Next i
Application.Echo True


Does anyone know how to go about doing this same task with an ADP
application? Also, if there are any utilities out there that would let
me interrogate an ADP application I'd love to know of them. I have
used Object Dependency Browser from AADconsulting in the past, but it
doesn't seem to work with ADP. I also downloaded a trial version of
Total Access Detective but it too, does not seem to work with ADP
applications.

Any help would be appreciated.
Craig
 
Thank you for your quick response Bill. When I run the code as you
have written it, I am getting an "Expected array" on this part:
"Reports(s).RecordSource "

I have tried to modify that line several ways but I still keep getting
the error. Any suggestions?

Thanks,
Craig
 
Nevermind, I figured out what was the problem. I needed to make the
line read like this:

Debug.Print "RecordSource: " & Application.Reports(s).Recordsource

to reference the Application object. As soon as I did that, it worked
like a charm.

Thanks Bill you got me right where I needed to be!

Craig
 
Back
Top