D
dsc2bjn
I have a form with 9 check boxes. Each check box represents a data element
within the same table. Only 1 of the check boxes must be checked in order
for the record to be accepted into the data table.
I have written a validation which works for other required values; however,
when the same logic is applied to the check box nothing happens. The message
box does not appear. If I change the "0" value (which should represent an
unchecked box) to 1, the validation works fine (all check boxes are checked).
What is wrong with this:
On Error GoTo Err_Command44_Click
If (Eval("[Forms]![SAR Data Entry]![Confirmation]=0")) And _
(Eval("[Forms]![SAR Data Entry]![DOCUMENT ANALYSIS]=0")) And _
(Eval("[Forms]![SAR Data Entry]![Interview]=0")) And _
(Eval("[Forms]![SAR Data Entry]![Observation]=0")) And _
(Eval("[Forms]![SAR Data Entry]![Physical Examination]=0")) And _
(Eval("[Forms]![SAR Data Entry]![QUESTIONNAIRE]=0")) And _
(Eval("[Forms]![SAR Data Entry]![Sampling]=0")) And _
(Eval("[Forms]![SAR Data Entry]![TRANSACTION TESTING]=0")) And _
(Eval("[Forms]![SAR Data Entry]![TO BE DETERMINED]=0")) Then
MsgBox "A Value for 'Testing Methods' is Required.", vbOKOnly, "Message
title"
End If
If (Eval("[Forms]![SAR Data Entry]![AU] Is Null")) Then
MsgBox "A Value for 'AU' is Required.", vbOKOnly, "Message title"
End If
If (Eval("[Forms]![SAR Data Entry]![SAR Question] Is Null")) Then
MsgBox "A Value for 'SAR Question' is Required.", vbOKOnly, "Message
title"
End If
If (Eval("[Forms]![SAR Data Entry]![Weakness] Is Null")) Then
MsgBox "A Value for 'Weakness' is Required.", vbOKOnly, "Message title"
Else
DoCmd.Close
End If
Exit_Command44_Click:
Exit Sub
Err_Command44_Click:
MsgBox Err.Description
Resume Exit_Command44_Click
End Sub
within the same table. Only 1 of the check boxes must be checked in order
for the record to be accepted into the data table.
I have written a validation which works for other required values; however,
when the same logic is applied to the check box nothing happens. The message
box does not appear. If I change the "0" value (which should represent an
unchecked box) to 1, the validation works fine (all check boxes are checked).
What is wrong with this:
On Error GoTo Err_Command44_Click
If (Eval("[Forms]![SAR Data Entry]![Confirmation]=0")) And _
(Eval("[Forms]![SAR Data Entry]![DOCUMENT ANALYSIS]=0")) And _
(Eval("[Forms]![SAR Data Entry]![Interview]=0")) And _
(Eval("[Forms]![SAR Data Entry]![Observation]=0")) And _
(Eval("[Forms]![SAR Data Entry]![Physical Examination]=0")) And _
(Eval("[Forms]![SAR Data Entry]![QUESTIONNAIRE]=0")) And _
(Eval("[Forms]![SAR Data Entry]![Sampling]=0")) And _
(Eval("[Forms]![SAR Data Entry]![TRANSACTION TESTING]=0")) And _
(Eval("[Forms]![SAR Data Entry]![TO BE DETERMINED]=0")) Then
MsgBox "A Value for 'Testing Methods' is Required.", vbOKOnly, "Message
title"
End If
If (Eval("[Forms]![SAR Data Entry]![AU] Is Null")) Then
MsgBox "A Value for 'AU' is Required.", vbOKOnly, "Message title"
End If
If (Eval("[Forms]![SAR Data Entry]![SAR Question] Is Null")) Then
MsgBox "A Value for 'SAR Question' is Required.", vbOKOnly, "Message
title"
End If
If (Eval("[Forms]![SAR Data Entry]![Weakness] Is Null")) Then
MsgBox "A Value for 'Weakness' is Required.", vbOKOnly, "Message title"
Else
DoCmd.Close
End If
Exit_Command44_Click:
Exit Sub
Err_Command44_Click:
MsgBox Err.Description
Resume Exit_Command44_Click
End Sub