+ Reply to Thread
Results 1 to 2 of 2

Calling the same userform, continues to run through after the "call"

  1. #1
    Registered User
    Join Date
    05-25-2011
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    52

    Calling the same userform, continues to run through after the "call"

    Alright here's my issue:
    I have a user form that allows the user to enter an ID #. I have code that checks to make sure the ID# was entered correctly. If it wasn't it prompts them to check for typos and reenter. Then I do userform.show. Effectively starting over. But the problem is that it calls the userform, runs it with the "fixed" entry, completes the user form code, then continues from the previous point where the error was found. For example,

    User enters ABCDFG
    code checks to see if there is a mistake, there is, it should be ABCDEFG.
    MsgBox("typo, please fix")
    userform1.show

    User enters ABCDEFG
    code checks to see if there is a mistake, there isn't
    code runs all the way through

    code continues from check #1 with ID# = to ABCDFG

    I don't want it to come back to where I called the next userform and continue. Is there a way to do what I'm trying to but only have it run once. Is it clear what I'm asking?

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Calling the same userform, continues to run through after the "call"

    Are you using that 'check code' in the exit event?

    e.g.
    Please Login or Register  to view this content.
    This example will prevent the textbox2 from being left blank.

    It will stay in the textbox2 until something is added. You can adapt your check code to confirm a ID#. (But if you have a list of ID numbers on the sheet, you should be putting them into a combobox and letting the user pick it.)
    David
    (*) Reputation points appreciated.

+ 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