Has a box not been checked?

Please help me to have a good weekend. I have a bug.OK. I have a dialogbox which contains a dynamically populated checkbox field and a comments field. In the queryClose of the dialogbox I want to check if any of the values of the checkbox are not checked off, if this is the case then the user must enter comments. This seems very simple and yet I haven’t been able to figure it out.

Can anyone help? Thanks.

Subject: has a box not been checked?

I will do it with this formula in the validation form of the last field in position in the form.

@if( Check=“” & Comments=“”; @failure(“Error”); @success)

Subject: RE: has a box not been checked?

Not exactly what I need because there might be perhaps 10 choices in the check box. I need to know if anything other than all 10 have been checked (like only 9 have been checked or only 3 have been checked). I don’t care how many have been checked but I do need to know if at least one has been left unchecked.Thanks!

Subject: RE: has a box not been checked?

If Ubound(dialog_doc.FieldName) < NUMBER_OF_CHOICES_MINUS_ONE Then

Since the back-end value is an array of the selected values (zero-based), then if there are ten choices available and the Ubound of the values array is only 9, then one value is not checked.

Subject: RE: has a box not been checked?

Thanks Stan -But I don’t know the size of the array. I build the array prior to dialogbox creation. Do I need to pass the array size? - I’ll try that.

I hope you’ve adjusted to your move - thanks again

Subject: That worked - Thanks

Sub Queryclose(Source As Notesuidocument, Continue As Variant)Set doc = source.Document

If source.DialogBoxCanceled = False Then

If (Ubound(doc.accessTo) < (doc.arraySize(0)-1)) And doc.NComments1(0) = “” Then

continue = False

Messagebox “Please provide comments.”, MB_OK, “Lotus Notes”

Call source.gotoField(“NComments1”)

Exit Sub

End If

End If

End Sub