userform frame control

J

Jo

Hi
I am trying to use a userform with 2 frames. On the
intialize I would like frame2 to be all disable then on
clicking frame1 be enable.
Help!!!
This code below does not work.
Thanks in advance
Jo

Private Sub UserForm2_Initialize()
Frame2.Controls = False
End Sub
 
J

Jo

Hi
I cannot get this to work. May be I am asking the wrong
question.
I would like frame2 and all the option buttons within the
frame 'greyed out'.
I have the form linked to a commed button with the
following code
Private Sub CommandButton2_Click()
UserForm2.show
End Sub
does this overide the intialize event?
Thanks again
Jo
 
T

Tom Ogilvy

Private Sub Frame1_Click()
Frame2.Enabled = True
Dim ctrl As Control
For Each ctrl In Frame2.Controls
ctrl.Enabled = True
Next
End Sub

Private Sub UserForm_Initialize()
Dim ctrl As Control
Frame2.Enabled = False
For Each ctrl In Frame2.Controls
ctrl.Enabled = False
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top