[AccessD] Forms/Queries Relationships

jack drawbridge jackandpat.d at gmail.com
Wed Mar 20 12:31:37 CDT 2013


Kathryn,

I'm not aware of anything built in (other than the Documentor).
But here is a routine to open each report and list the name and the
recordsource to immediate window. Hope it helps.
It could be setup to populate a table. I haven't tried to parse the
output/recordsource to identify tables specifically.

Sub ListReportRecordSources()

' List the recordsources of all reports.


    On Error GoTo Err_Handler

    Dim db As DAO.Database
    Dim Doc As DAO.Document

    Dim lngReportCount As Long

    Debug.Print "*** Beginning scan of Reports for Record Source field "

    Set db = CurrentDb

    For Each Doc In db.Containers("Reports").Documents

        DoCmd.OpenReport Doc.name, acDesign, WindowMode:=acHidden

        With Reports(Doc.name)

            lngReportCount = lngReportCount + 1

            Debug.Print "Report " & .name & " RecordSource: " &
.RecordSource

            DoCmd.Close acReport, .name
        End With
    Next Doc

Exit_Point:
    Set Doc = Nothing
    Set db = Nothing

    Debug.Print "*** Scanned " & lngReportCount & " reports."
    Exit Sub

Err_Handler:
    MsgBox Err.Description, vbExclamation, "Error " & Err.number
    Resume Exit_Point

End Sub

On Wed, Mar 20, 2013 at 1:10 PM, Kathryn Bassett <kathryn at bassett.net>wrote:

> I have an mdb with 3 (stand-alone) tables, 49 queries, 2 forms (I tend to
> not use them, as it's easier to use the queries), and 38 reports. I want to
> do some housekeeping by eliminating some of the queries, and re-naming some
> of them. But I need to know which reports refer to what queries.
>
> My question: Is there some built-in utility that will give me a list of
> each
> of the report names, with the name of the query or table it is based on?
> (Yes, I think there are a couple of the first made reports that are based
> on
> the table instead of a query, from when I didn't know better).
>
> --
> Kathryn Rhinehart Bassett (Pasadena CA)
> "Genealogy is my bag" "GH is my soap"
> kathryn at bassett.net
> http://bassett.net
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list