oxicottin
Learning by pecking away....
- Local time
- Today, 18:30
- Joined
- Jun 26, 2007
- Messages
- 856
Hello, I want to highlight a control red if the tag says "Required" and I want to highlight the controls that the tag says "VerifyEmailorPrint". I can get that part BUT upon opening the form If there are controls that don't have data that is "Required" I want a message saying so and same goes for the "VerifyEmailorPrint". How would I go about this and what would I add to my function or the load/open event? Thanks!
I forgot to add, I cant get my option group to highlight. I tried adding 0 and nothing for its default and still wont highlight.
I forgot to add, I cant get my option group to highlight. I tried adding 0 and nothing for its default and still wont highlight.
Code:
Public Function HighlightValidation()
Dim ctl As Control
For Each ctl In Me.Controls
With ctl
Select Case .ControlType
Case acTextBox, acComboBox, acListBox, acCheckBox, acOptionGroup, acTextBox
If .Tag = "Required" Then
If IsNull(.Value) Or .Value = 0 Then
.BorderColor = vbRed
.BorderWidth = 3
End If
End If
If .Tag = "VerifyEmailorPrint" Then
If IsNull(.Value) Or .Value = 0 Then
.BorderColor = vbYellow
.BorderWidth = 3
End If
End If
Case Else
'Return to origional colors
.BorderColor = 14270637
.BorderWidth = 0
End Select
End With
Next ctl
End Function