Results 1 to 4 of 4

Thread: [RESOLVED] Locating a control in a multipage

  1. #1

    Thread Starter
    Addicted Member Fonty's Avatar
    Join Date
    May 2006
    Location
    New York
    Posts
    173

    Resolved [RESOLVED] Locating a control in a multipage

    Suppose you have a multipage with n pages. In each page there are some textboxes.
    Is it possible to get the page number where one specific textbox lies?
    Last edited by Fonty; May 24th, 2007 at 11:35 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [RESOLVED] Locating a control in a multipage

    If this is resolved, please post your resoultion as it may help someone else with the same or similiar problem.

  3. #3

    Thread Starter
    Addicted Member Fonty's Avatar
    Join Date
    May 2006
    Location
    New York
    Posts
    173

    Re: [RESOLVED] Locating a control in a multipage

    I called the n pages of the multipage mpgMap as follows: pg1, pg2, pg3,..., pg8
    The number of every page is the same as the mpgMap.Value, then in order to locate the controls I use the following code

    vb Code:
    1. Sub Check()
    2.  
    3. Dim c As Control
    4. Dim origin as Integer
    5.  
    6. For Each c in mpgMapa.Controls
    7. 'Checks if the textboxes in the multipage contain only numbers
    8. If Left(c.Name,6) = "txtBox" And IsNumeric(c) = False Then
    9. 'Pops up a warning message
    10. msgbox "You must fill the case with numbers", "ERROR"
    11. 'Get the number of the page where the textbox lies
    12. origin = Right(c.parent.Name,1)
    13. 'Activate the page
    14. mpgMap.Value = origin
    15. 'Activate the textbox
    16. c.SetFocus
    17. Next
    18.  
    19. End Sub
    Ps. I can't get this thing to format the code
    Last edited by Hack; May 25th, 2007 at 07:04 AM. Reason: Added VB Highlight Tags

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [RESOLVED] Locating a control in a multipage

    Quote Originally Posted by Fonty
    Ps. I can't get this thing to format the code
    There are two ways to format your code (I edited you previous post and add highlight tags, which is one way.)

    The two ways are using either [highlight=vb]your code goes in here[/highlight]

    Or

    [code]your code goes here[/code]

    The code tags are more used as the code is more easily copied by other members than code surrounded by the highlight tags.

Posting Permissions

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



Click Here to Expand Forum to Full Width