text boxes and check boxes in frames in VBA

VBAmalta89

Board Regular
Joined
Mar 25, 2011
Messages
116
I have a user form which has 8 frames. The user selects how many of the frames to activate by means of a text box.

Within each frame are a list of check boxes, adjacent to which are text boxes. What I would like to do is to have all text boxes inactive until the user checks the adjacent check box of each text box.

Is this possible?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Yes it is possible. One way to do it would be to disable the textboxes during development of your form and then adding some code like this:

Code:
Private Sub CheckBox1_Click()
    TextBox1.Enabled = True
End Sub
Private Sub CheckBox2_Click()
    TextBox2.Enabled = True
End Sub
 
Upvote 0
You can set their enabled property to false in the IDE or you can do it view code when the form is initialized like this:

Code:
Private Sub UserForm_Initialize()
    TextBox1.Enabled = False
End Sub
 
Upvote 0
my problem is that when the user enters the number of frames to activate, the text boxes within the frames are being enabled prior to checking their adjacent check boxes!
 
Upvote 0
And I have already told you how to solve that problem, you need to either disable the textboxes during design time in the IDE or via code when the form is initialized.
 
Upvote 0
I did that thats why i had to post again to tell you that for some reason they wer being enabled again wen the user enters the number of frames to activate as i explained in the previous post
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top