Home  |  About  |   Search   

What's New
Table Of Contents
Credits
Netiquette
10 Commandments 
Bugs
Tables
Queries
Forms
Reports
Modules
APIs
Strings
Date/Time
General
Downloads
Resources
Search
Feedback
mvps.org

RunCommand Constants

Terms of Use


 

Forms: Control Arrays in Access

Author(s)
Dev Ashish

    Unlike VB, Access forms do not support control arrays.

    A control array is a group of controls that share the same name and type. They also share the same event procedures. A control array has at least one element and can grow to as many elements as your system resources and memory permit; its size also depends on how much memory and Windows resources each control requires.

    We can create an array of controls, but not a control array.   One workaround is to append a number as a suffix to all similar controls. For example, if we had controls named "txtUser1", "txtUser2", "txtUser3"......"txtUser10", then we could refer to all these controls from a loop as

Dim intI as integer
    For i=1 to 10
        debug.print me("txtUser"& cstr(i)).Name
    Next

1998-2009, Dev Ashish & Arvin Meyer, All rights reserved. Optimized for Microsoft Internet Explorer