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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I lock the Optionbutton within some frames

Status
Not open for further replies.

ii128

Programmer
May 18, 2001
129
US
I try to lock the Optionbutton within some frames, but I can't.

Following is my code. Any one can help me fix?


Dim ctl As Control
Dim Str() As String
Dim i1 as integer

Str = Split("fraTest,fraTest1,fraTest2,fraTest3,fraTest4,fraTest5,fraTest6,fraTest7", ",")

For Each ctl In Form.Controls
For i1 = LBound(Str) To UBound(Str)
If ctl.Container Is Str(i1) Then
If TypeOf ctl1 Is OptionButton Then
ctl.Locked = False
End if
End If
Next i1
Next ctl
 
Cant you do it with

fra.Enabled = False

Will it not lock the Option button in the frame named fra.
 

It will lock every controls in the frame, but I just like to lock the optionbuttons



 
Option Buttons doesnt have Locked property.

Why dont you try with .Enabled property.
 
Sorry, I should say make the .Enabled property of Optionbuttons to False within some frames

Dim ctl As Control
Dim Str() As String
Dim i1 as integer

Str = Split("fraTest,fraTest1,fraTest2,fraTest3,fraTest4,fraTest5,fraTest6,fraTest7", ",")

For Each ctl In Form.Controls
For i1 = LBound(Str) To UBound(Str)
If ctl.Container Is Str(i1) Then
If TypeOf ctl1 Is OptionButton Then
ctl.Enabled = False
End if
End If
Next i1
Next ctl
 
But my codes doesn't work.

Any help to fix my code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top