Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 02:32 PM
Pieter Linden
Guest
 
Posts: n/a
Default Printing rowsources of all Reports. "Document" type not recognized

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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.