+ Reply to Thread
Results 1 to 4 of 4

stop userform from initializing

  1. #1
    JT
    Guest

    stop userform from initializing

    I have a form. On the form is a "Submit" and "Quit"
    button. If the user pushes the "Submit" button, the macro
    checks to see if any information has been entered. If
    not, a message is displayed telling them to enter info or
    use the "Quit" button.

    If they select the "Quit" button, , the macro clears out
    some labels and text boxes and closes the form. The
    intent is when the form is opened the next time, it is
    populated with new values.

    The problem, I'm having is that when the user clicks on
    the "Quit" button, the UserForm_Initialize module is
    automatically kicked off and populate the labels and text
    boxes with wrong information.

    How can I stop the UserForm_Intialize module from being
    kicked off when the "Quit" button is pushed.

    Thanks for the help........

  2. #2
    Chip
    Guest

    Re: stop userform from initializing

    What is your code for the Quit Button?


  3. #3
    Bob Phillips
    Guest

    Re: stop userform from initializing

    The Userform_Initialize is triggered when the form is loaded. How does the
    Quit button have anything to do with it?

    You could try setting a variable, and on quit clear everything out, and hide
    the form. Next show of the form, in Userform_Activate, if the variable is
    set do nothing, else initialize.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "JT" <[email protected]> wrote in message
    news:[email protected]...
    > I have a form. On the form is a "Submit" and "Quit"
    > button. If the user pushes the "Submit" button, the macro
    > checks to see if any information has been entered. If
    > not, a message is displayed telling them to enter info or
    > use the "Quit" button.
    >
    > If they select the "Quit" button, , the macro clears out
    > some labels and text boxes and closes the form. The
    > intent is when the form is opened the next time, it is
    > populated with new values.
    >
    > The problem, I'm having is that when the user clicks on
    > the "Quit" button, the UserForm_Initialize module is
    > automatically kicked off and populate the labels and text
    > boxes with wrong information.
    >
    > How can I stop the UserForm_Intialize module from being
    > kicked off when the "Quit" button is pushed.
    >
    > Thanks for the help........




  4. #4
    RB Smissaert
    Guest

    Re: stop userform from initializing

    This is something I recently learned.
    Possibly you have a reference to the userform after unloading the form.
    So for example:

    Unload Userform
    Userform.Caption = ""

    Would trigger the initialize event.

    Best show the code of the Quit button and we can see.


    RBS


    "JT" <[email protected]> wrote in message
    news:[email protected]...
    >I have a form. On the form is a "Submit" and "Quit"
    > button. If the user pushes the "Submit" button, the macro
    > checks to see if any information has been entered. If
    > not, a message is displayed telling them to enter info or
    > use the "Quit" button.
    >
    > If they select the "Quit" button, , the macro clears out
    > some labels and text boxes and closes the form. The
    > intent is when the form is opened the next time, it is
    > populated with new values.
    >
    > The problem, I'm having is that when the user clicks on
    > the "Quit" button, the UserForm_Initialize module is
    > automatically kicked off and populate the labels and text
    > boxes with wrong information.
    >
    > How can I stop the UserForm_Intialize module from being
    > kicked off when the "Quit" button is pushed.
    >
    > Thanks for the 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