One thing I have done on a form of mine is to have a column somewhere that evaluates each field or range and returns a count. Then I just sum this column, and if the count is not appropriate, I display a message and then cancel the action.
I write my formulas to evaluate to 0 if field meets the requirement, and 1 or more if input is still required.
For instance, say we have a text field/cell that needs input, like a name field. The simple formula would be:
=If(A1 = "", 1, 0)
You could also modify it to include a dependancy on another field. Int he formula below, assume A1 is a field for hours worked. Cell B1 would be a reason for overage.
=If(and(A1 > 40, B1 = ""), 1,0)
For a range of cells, you could do something like:
=Countif(A1:A10, "")
Anyway, so you just construct a formula or series of formulas to test your form for required input. Then you just do a sum of the requirements testing column. If it is greater than 0, then input is required.
You enforce this by using code like this at the beginning of your event procedure:
Bookmarks