Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disable checkboxes 2

Status
Not open for further replies.

cspm2003

Programmer
Nov 24, 2004
78
DE
Hi,

I have a form called userform1. I load this form using a sub. I use the command

UserForm1.show

now, on this Form there are a couple of checkboxes, I have to do some checks on the document, and depending on the resuls the checkboxes are supposed to get enabled or disabled. The code to enable/disable works if I create an extra button on the form and then call the sub that contains the checking stuff, but I want that to get executed automatically, so as soon as the form opens only the needed checkboxes are enabled.

I tryed to do the checking before I open the form, but that didnt work. I was thinking about using the form_load event, but that didnt really work either, or I just did it wrong.

any suggestions?
 
that doesnt work aswell. If I debug the script, it just opens the userform and doesnt go through the form_load or Form_Activate
 
Do any of your forms other events fire after you called it using .show?
As far as I knew Form_Activate always fired (even if the form has only been hidden whereas Load and Initialize don't fire if it is hidden and called this way) if the form was called via that method.

Cheers

Harleyquinn

---------------------------------
For tsunami relief donations
 
You work with userform, hot acces/vb forms, the event procedures start with UserForm, there is no Load event. Just, in the userform code module, select UserForm from the left dropdown and appropriate event from right dropdown. VBA will write the proper syntax for you.

combo
 
Hi, it works now. thx combo.

vb insertet this code:

Private Sub UserForm_Activate()
´
I only used

Private Sub Form_Activate() thats why it didnt work.

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top