Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Loop through All forms recordsources

Posted on 2008-10-13
1
Medium Priority
?
482 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

886 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