Solved

Loop through All forms recordsources

Posted on 2008-10-13
1
425 Views
Last Modified: 2013-11-05
Hi Experts

I have about 80 forms and most of them have a recordsource. How can i get the recordsource from each form?
0
Comment
Question by:DCRAPACCESS
1 Comment
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 22702051

Sub getFormRS()
Dim objAcc As AccessObject
    On Error Resume Next
    For Each objAcc In Application.CurrentProject.AllForms
        DoCmd.OpenForm objAcc.Name, acDesign
        Debug.Print Forms(objAcc.Name).RecordSource
        DoCmd.Close acForm, frm.Name, acSaveYes
    Next objAcc

End Sub
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now