Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    control array (Access2000)

    I understand that while Access does not have the same feature as in VB for control array, I remember that you can use the ME and & prefixes to loop through a series of control. I wonder if anyone out there can provide a sample routine to demo this loop. For example, I have some controls with the names Text1, Text2, Text3, .... and others and I just want to loop through those Text with number at the end.

    Thanks

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: control array (Access2000)

    You must know the exact name configuration (in your example, you only want the controls that start with "text"). The following example locks all the "Text" controls:

    Dim intC as integer

    on error resume next 'this will prevent failure for missing #'s

    for each intC=0 to ??? ' you need to put max # here
    Me( "Text" & intC).locked = True
    Next intC

    on error goto 0
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: control array (Access2000)

    Thanks Mark,

    Me( "Text" & intC) is exactly the syntax that I am looking for.

    Simon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •