M
Mary
I found the code below to validate a field which is working well. I have the
code in the On Click event of the "Emergency" checkbox. I want the checkbox
to be left unchecked if the Bridge_Num field is null. I do get the message
box, but the Emergency checkbox is checked. What code do I need to add to
set the value back to No for the checkbox? Thank you! Mary
Private Sub Emergency_Click()
If IsNull(Me.Bridge_Num) Then
For Each ctl In Me.Controls
If (ctl.ControlType = acTextBox _
Or ctl.ControlType = acComboBox) _
And ctl.Tag = "Validate" Then
If Nz(ctl, "") = "" Then
MsgBox ("Please enter Bridge information!")
Cancel = True
Exit For
End If
End If
Next ctl
End If
End Sub
code in the On Click event of the "Emergency" checkbox. I want the checkbox
to be left unchecked if the Bridge_Num field is null. I do get the message
box, but the Emergency checkbox is checked. What code do I need to add to
set the value back to No for the checkbox? Thank you! Mary
Private Sub Emergency_Click()
If IsNull(Me.Bridge_Num) Then
For Each ctl In Me.Controls
If (ctl.ControlType = acTextBox _
Or ctl.ControlType = acComboBox) _
And ctl.Tag = "Validate" Then
If Nz(ctl, "") = "" Then
MsgBox ("Please enter Bridge information!")
Cancel = True
Exit For
End If
End If
Next ctl
End If
End Sub