Validating Data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I prevent a record from being updated or inserted if two data
elements are null? I don't want to require the user to enter both data
elements, but I want to ensure that at least one contains a valid value be
before a record can updated or inserted into a table. This seems pretty basic
but I coming up short trying to find a way to enforce this in a table design.

Thanks,
Ron
 
With the report open in design view, open the Properties box (View menu.)

Set the Validation Rule in the properties box to:
([Field1] Is Not Null) OR ([Field2] Is Not Null)
replacing Field1 and Field2 with your field names.

The validation rule in the Properties box is the rule for the table, and is
applied to the record (as distinct from the rule in the lower pane which
applies to one field.)
 
With the report open in design view, open the Properties box (View menu.)

Set the Validation Rule in the properties box to:
([Field1] Is Not Null) OR ([Field2] Is Not Null)
replacing Field1 and Field2 with your field names.

I think you mean the Table design, not the Report design!

all the best


Tim F
 
You do not mention what type of data goes into those two elements. But, if
the data was numeric, it seems you could just check the sum of the two, to
see if it is >0, before allowing the update. If they are text fields, you
could combine them, and then check that the length of the text is >0.
 
Back
Top