[AccessD] For all forms

Arthur Fuller fuller.artful at gmail.com
Wed Aug 4 10:06:41 CDT 2021


How do I get the type of control? As it happens, combos and list boxes are
my main interest.

On Wed., Aug. 4, 2021, 8:33 a.m. Gustav Brock via AccessD, <
accessd at databaseadvisors.com> wrote:

> Hi Arthur
>
> That’s because only objects of type ListBox and ComboBox, not the generic
> Control,  have this property.
>
> /gustav
>
> 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:
>
> <code>
> 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
>         Next
>     Next
>
> End Function
> </code>
>
> /gustav
>
> -----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
>     Next
> Next
>
> Do you have such a chunk? Or at least remind me of the syntax?
> Thanks
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list