zufie wrote:
I have a main form containing 2 checkboxes.
The respective checkboxes when checked cause the SepcialEffect
Property to make all the textboxes to appear Shadowed.
1)Although the Textboxes and Combo Boxes required to appear Shadowed
are almost the same regardless of the checkbox that is checked how do
I cause individual textboxes to appear Flat?
2)How do I cause the Textboxes and Combo Boxes to highlight upon
checking the respective checkbox?
Here is my code:
Private Sub ChckIBCCP_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Shadow1" And ChckIBCCP = True _
And ctl.ControlType = 109 Then
ctl.SpecialEffect = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffect = 1
End If
Next
End Sub
Private Sub ChckOtherReferral_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Shadow1" And ChckOtherReferral = True _
And ctl.ControlType = 109 Then
ctl.SpecialEffect = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffect = 1
End If
Next
End Sub
Thanks,
John
Realize if a textbox the ControlType value is 109. AcTextBox is also
109. So you are excluding everything but textboxes.
OK...first I'd create an Option Group. Find that control on the
toolbox. Create 2 checkboxes for that option group. ChckIBCCP = 1,
ChckOtherReferral = 2
With an option group it's going to either be one of the checkboxes or
the other. You can combine your two subs into one sub.
Now, put in the word Shadow1 for the tag property of all those controls
you want affected with ChckIBCCP. Leave all others blank.
Private Sub FrameSelection_Click()
Dim ctl As Control 'for looping.
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or _
ctl.ControlType = acComboBox Then
'its a text box or combo box.
If Me.FrameSelection = 1 Then
'ChckIBCCP selected
ctl.SpecialEffect = IIf(ctl.Tag = "Shadow1", 4, 1)
Else
ctl.SpecialEffect = IIf(ctl.Tag <"Shadow1", 4, 1)
End If
End If
Next
End Sub
For the FrameSelection, I set the default to the ChckIBCCP value (or 1).
I can then call the next sub in the OnOpen or OnCurrent event if needed.
Private Form_Current()
FrameSelection_Click
End Sub
Golosa
http://www.youtube.com/watch?v=tY8uU0PFFb0