Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

simple question, need keyword...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andre L - 22 Dec 2005 19:58 GMT
I wrote a function to look thru all tables and queries in a db to find a
specified string.  I used keywords: TableDefs and: QueryDefs in my code.  I
want to create a similar function to look through report definititons.  Is
this possible?  I see no: ReportDefs variable......
Marshall Barton - 22 Dec 2005 20:47 GMT
>I wrote a function to look thru all tables and queries in a db to find a
>specified string.  I used keywords: TableDefs and: QueryDefs in my code.  I
>want to create a similar function to look through report definititons.  Is
>this possible?  I see no: ReportDefs variable......

That's an awful lot of work to save a few bucks on already
available add ins.

Anyway, to answer your question:

For Each doc In db.Containers("Reports").Documents
    DoCmd.OpenReport doc.Name, acDesign
    With Reports(doc.Name)
        ' do your thing here
    End With
    DoCmd.Close scReport, doc.Name, acSaveNo
Next doc

Starting in A2k, you could also achieve this using the
AllReports collection (see Help), but I'm not sure it makes
anything easier.

Signature

Marsh
MVP [MS Access]

Andre L - 23 Dec 2005 20:29 GMT
not sure about the addins but thanks for the code!

>>I wrote a function to look thru all tables and queries in a db to find a
>>specified string.  I used keywords: TableDefs and: QueryDefs in my code.  I
[quoted text clipped - 17 lines]
>AllReports collection (see Help), but I'm not sure it makes
>anything easier.
Andre L - 23 Dec 2005 20:54 GMT
HOW DO YOU DEFINE DOC?  I am using Access 2000.

>>I wrote a function to look thru all tables and queries in a db to find a
>>specified string.  I used keywords: TableDefs and: QueryDefs in my code.  I
[quoted text clipped - 17 lines]
>AllReports collection (see Help), but I'm not sure it makes
>anything easier.
TC - 24 Dec 2005 02:16 GMT
db would of course be:

    dim db as datbase
    set db = curentdb()

and doc would be:

    dim doc as document

HTH,
TC
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.