M
Marc
Hi,
I have a problem with the code below.
I cant understand why Im not allowed to pass on the frame object for
later use in the code.
I am using this because I have several comboboxes in different frames
that should use the same code.
Sub ComboBox_6_Rental_RQ_DropButtonClick()
Dim ActiveFrame As Control
Dim Ctrl As Control
Set ActiveFrame = Me.Frame_6_Rental
If Me.ActiveControl = "Yes" Then
For Each Ctrl In Me.ActiveFrame.Controls
If TypeName(Ctrl) = "ComboBox" Or TypeName(Ctrl) =
"TextBox" Then
Me.ActiveFrame.Ctrl.Enabled = True
Me.ActiveFrame.Ctrl.BackColor = RGB(255, 255, 255)
End If
Next
Else
For Each Ctrl In Me.ActiveFrame.Controls
If TypeName(Ctrl) = "ComboBox" Or TypeName(Ctrl) = "TextBox"
Then
Me.ActiveFrame.Ctrl.Enabled = True
Me.ActiveFrame.Ctrl.BackColor = RGB(150, 150, 150)
End If
Next
End If
End Sub
Hope you can help me.
Cheers
Marc
I have a problem with the code below.
I cant understand why Im not allowed to pass on the frame object for
later use in the code.
I am using this because I have several comboboxes in different frames
that should use the same code.
Sub ComboBox_6_Rental_RQ_DropButtonClick()
Dim ActiveFrame As Control
Dim Ctrl As Control
Set ActiveFrame = Me.Frame_6_Rental
If Me.ActiveControl = "Yes" Then
For Each Ctrl In Me.ActiveFrame.Controls
If TypeName(Ctrl) = "ComboBox" Or TypeName(Ctrl) =
"TextBox" Then
Me.ActiveFrame.Ctrl.Enabled = True
Me.ActiveFrame.Ctrl.BackColor = RGB(255, 255, 255)
End If
Next
Else
For Each Ctrl In Me.ActiveFrame.Controls
If TypeName(Ctrl) = "ComboBox" Or TypeName(Ctrl) = "TextBox"
Then
Me.ActiveFrame.Ctrl.Enabled = True
Me.ActiveFrame.Ctrl.BackColor = RGB(150, 150, 150)
End If
Next
End If
End Sub
Hope you can help me.
Cheers
Marc