Blanket Field Validation

I have a form with about 20 fields and all all of them need to be completed before the document is submitted and saved. Is there anyway to force completion of all fields without having to write code for each of the fields.

Paul

Subject: Blanket Field Validation

You could put code in each of the separate field vaidation eventsor …

You could put one piece of code in the QuerySave event.

Works either way. Using QuerySave is my preference because I can see and and all dependencies in one location.

Collin

Subject: Blanket Field Validation

Paul, as Collin suggested, use the QuerySave event. Code below should get you started.

You can create an array of field names using

FieldNameList = Evaluate({“Field1” : “Field2” : “Field3” : Etc"})

Substitute your field names in the list.

Assuming you’ve defined uidoc somewhere before here,

ErrorField$ = “”

For j% = LBound(FieldNameList) to UBound(FieldNameList)

If Trim$(uidoc.FieldGetText(FieldNameList(j%))) = "" Then

ErrorField$ = FieldNameList(j%)

Exit For

End If

Next

If ErrorField$ <> “” then

Msgbox “Something”

call uidoc.GotoField(ErrorField$)

End If

Subject: RE: Blanket Field Validation

This is exactly what I was looking for.

Thanks guys!