By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,635 Members | 913 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,635 IT Pros & Developers. It's quick & easy.

Printing rowsources of all Reports. "Document" type not recognized

P: n/a
I found this code posted by FredG (thanks Fred!)

This will cycle through all your reports.

Public Sub GetRecordSource()
' Print out the RecordSource for each report.
Dim doc As Document
Dim cont As Container

With CurrentDb
For Each cont In .Containers
If cont.Name = "Reports" Then
For Each doc In cont.Documents
DoCmd.OpenReport doc.Name, acViewDesign
Debug.Print " Report Name " & doc.Name
Debug.Print "Record Source " &
Reports(doc.Name).RecordSource
DoCmd.Close acReport, doc.Name
Next doc
End If
Next cont
End With

--
Fred
I'm using Access2000 (I have XP on this machine as well).

When I try to compile it, it doesn't recognize the "Document"
variable. Any idea what library I have to reference for that? Right
now I have DAO 3.6... do I need ADO or something? Or the
Extensibility libraries?

This is a prehistoric database that I'm trying to document enough so
that I can rebuild it completely from scratch. (Yes, I know I
shouldn't but the original code is from like Access 1.x or 2.0, and
lots of it just plain doesn't work.)

I know I shouldn't post this here in the same thread, but after
reading Tony Toews's explanations for why you get seemingly random
corruptions.

3043 - "disk or network error" is a generic message almost always
indicating a network problem of some sort.

I've recovered this database multiple times. Is there an object in
here that's just hopelessly corrupted? IF so, how do I find it?

Thanks,
Pieter
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.