[AccessD] For all forms

Gustav Brock gustav at cactus.dk
Wed Aug 4 07:33:30 CDT 2021

Hi Arthur

That’s because only objects of type ListBox and ComboBox, not the generic Control,  have this property.


Fra: Arthur Fuller <fuller.artful at gmail.com>
Sendt: 4. august 2021 14:29
Til: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Cc: Gustav Brock <gustav at cactus.dk>
Emne: Re: [AccessD] For all forms

Hmm. The compiler and Intellisense  don't like the reference to RowSource. I can't see anything  similar  in Intellisense.

On Wed., Aug. 4, 2021, 7:39 a.m. Arthur Fuller, <fuller.artful at gmail.com<mailto:fuller.artful at gmail.com>> wrote:
You Are the man! I forgot one part. I. am only interested  in combo and list boxes. How do I specify the control type?

On Wed., Aug. 4, 2021, 6:15 a.m. Gustav Brock via AccessD, <accessd at databaseadvisors.com<mailto:accessd at databaseadvisors.com>> wrote:
Hi Arthur

It could be something like this:

Public Function ListControlSources()

    Dim Form    As Form
    Dim Control As Control

    On Error Resume Next

    For Each Form In Forms
        For Each Control In Form.Controls
            Debug.Print Form.Name, Control.Name, Control.RowSource

End Function


-----Oprindelig meddelelse-----
Fra: AccessD <accessd-bounces+gustav=cactus.dk at databaseadvisors.com<mailto:cactus.dk at databaseadvisors.com>> På vegne af Arthur Fuller
Sendt: 4. august 2021 11:50
Til: Access Developers discussion and problem solving <accessd at databaseadvisors.com<mailto:accessd at databaseadvisors.com>>
Emne: [AccessD] For all forms

I used to have code to do this but can't find it. Here is the algorithm.

For all forms
    For all controls in f
        ? Ctl.RowSource

Do you have such a chunk? Or at least remind me of the syntax?

More information about the AccessD mailing list