Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default stop userform from initializing

What is your code for the Quit Button?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop macro with userform Jeff Excel Discussion (Misc queries) 1 July 30th 07 02:38 PM
XL 07 Initializing Folders reno Excel Discussion (Misc queries) 0 April 20th 07 07:32 PM
Initializing Combobox in a Userform Neal[_5_] Excel Programming 2 September 15th 04 12:19 AM
Initializing static variables in VBA Adrian[_7_] Excel Programming 3 September 3rd 04 01:08 AM
Initializing Userform Szadkowski Excel Programming 1 August 31st 04 12:35 AM


All times are GMT +1. The time now is 08:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"