+ Reply to Thread
Results 1 to 5 of 5

Reference Userform Multipage Control

  1. #1
    Registered User
    Join Date
    03-16-2006
    Posts
    81

    Reference Userform Multipage Control

    I have the following code to loop through controls on a userform multipage to find a specific button.

    Is there a way to directly reference a control without looping through them all?

    Please Login or Register  to view this content.
    Many Thanks

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: Reference Userform Multipage Control

    Normally you loop through the controls collection because you have controls with a name that includes an index, such as Button1 Button2 etc, and VBA does not support control arrays.

    If you know the name of the control you can just reference it.

    Why are you looping?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-16-2006
    Posts
    81

    Re: Reference Userform Multipage Control

    I don't know the code to reference it directly, that's why i was using the loop. I have tried a few variations but couldn't get it to work. Can you tell me what the code is?

    Many Thanks

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: Reference Userform Multipage Control

    You haven't told us what the name is.

    Assume its cmdForward then

    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-16-2006
    Posts
    81

    Re: Reference Userform Multipage Control

    Thats perfect, many thanks.

    There are 20 or so pages each with a button called 0Forward (0 being the multipage number).

    Here is the code i used:
    Please Login or Register  to view this content.
    Once again, thanks for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1