Results 1 to 3 of 3
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Cycle through collection


    Can you step through a collection object and compare the key values to a variable?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    pretty simple

    Code:
    sub CycleThruColl (pcol as collection)
    dim itm
    
    for each itm in pcol
       if itm = "myValue" then  DoMyEvent
    next

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by ranman256 View Post
    pretty simple

    Code:
    sub CycleThruColl (pcol as collection)
    dim itm
    
    for each itm in pcol
       if itm = "myValue" then  DoMyEvent
    next
    Thanks - that is exactly what I required to get the job done. Thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Cycle through variables
    By Ruegen in forum Programming
    Replies: 9
    Last Post: 11-20-2014, 08:50 PM
  2. Cycle Through Parameters in VBA
    By kestefon in forum Access
    Replies: 3
    Last Post: 07-10-2014, 02:27 PM
  3. Replies: 3
    Last Post: 11-16-2012, 10:15 AM
  4. Recordset cycle problem
    By free_style in forum Programming
    Replies: 3
    Last Post: 08-25-2011, 02:44 PM
  5. Cycle Time
    By Dargo in forum Forms
    Replies: 5
    Last Post: 02-26-2009, 05:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums