hi, i m very sorry to say. but your code has a bug/error.. because as you used resume next, it also handle unwanted (not a child control of specific frame) that user may not want..
so, the following code only handle (disable/enable) the controls that parent is the frame.
however thanks for the idea..Code:Public Sub sEnableFrame(objFrame As Frame, ByVal bolFlag As Boolean) On Error GoTo mahabub_S1Error Dim objControl As Control objFrame.Enabled = bolFlag For Each objControl In Me.Controls If objControl.Container.Name = objFrame.Name Then If (TypeOf objControl Is Frame) Then sEnableFrame objControl, bolFlag Else objControl.Enabled = bolFlag End If End If mahabub_nextS1Loop: Next objControl Set objControl = Nothing Exit Sub mahabub_S1Error: If Err.Number = 438 Then Resume mahabub_nextS1Loop Exit Sub End If End Sub
best regards




Reply With Quote