+ Reply to Thread
Results 1 to 3 of 3

Calling User form Initialize: A way to display certain tab based on which sub called?

  1. #1
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Calling User form Initialize: A way to display certain tab based on which sub called?

    I'm not exactly sure how to explain this, but I currently have a sub that calls UserForm_Initialize() because I couldn't get my combo boxes to reload everytime something was added or deleted. So I called the sub, and this reloaded them for me.
    But then I was having the problem of my 2nd tab always displaying first when I did userform.show so I had to use MultiPage1.Value = 0

    Now, when I delete something (which is located on the second tab), it calls userform and shows the first tab.

    is there a way to specify certain things to happen upon which sub is doing the calling?

    For instance: If I press my delete button, can it call the user form but display tab 2? and if I press the, say, 'load form' button, can it call the user form but display tab 1?

    I'm not sure if this makes sense

    but here is the code that I am using. (OR, is there someway to reload my combo boxes without calling UserForm_Initialize)

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

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Calling User form Initialize: A way to display certain tab based on which sub called?

    move the code that loads the controls to a separate routine and call that from the initialize event and anywhere else you need to :-)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: Calling User form Initialize: A way to display certain tab based on which sub called?

    oh, DUH! Thanks JosephP!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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