1 field input required only if a value appears in another

M

mazer77

How do I make a field a required input based on the value of another field?
if the value of the other field is "0" then the input field is not required.
 
A

Allen Browne

mazer77 said:
How do I make a field a required input based on the value of another
field?
if the value of the other field is "0" then the input field is not
required.

Open the table in design view.

Open the Properties box.

Beside the Validation Rule in the properties box, enter:
([Field1] Is Null) OR ([Field2] Is Not Null)
substituting the names of your fields.

Be sure to use the Validation Rule in the properties (i.e. the one for the
table), not the one in the lower pane of table design window (which is the
rule for a field.)

Here's a bunch of validation rules:
http://allenbrowne.com/ValidationRule.html
 
M

mazer77

Thanks for your response. I understand that The rule is satisfied if Field1
is "BLANK". I want it to happen if any number is in field1, except "0", not
"null". If "0" is in field1 then field2 does not need to be filled in.

Thanks,

Allen Browne said:
mazer77 said:
How do I make a field a required input based on the value of another
field?
if the value of the other field is "0" then the input field is not
required.

Open the table in design view.

Open the Properties box.

Beside the Validation Rule in the properties box, enter:
([Field1] Is Null) OR ([Field2] Is Not Null)
substituting the names of your fields.

Be sure to use the Validation Rule in the properties (i.e. the one for the
table), not the one in the lower pane of table design window (which is the
rule for a field.)

Here's a bunch of validation rules:
http://allenbrowne.com/ValidationRule.html
 
A

Allen Browne

So you want:

([Field1] = 0) OR ([Field2] Is Not Null)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

mazer77 said:
Thanks for your response. I understand that The rule is satisfied if
Field1
is "BLANK". I want it to happen if any number is in field1, except "0",
not
"null". If "0" is in field1 then field2 does not need to be filled in.

Thanks,

Allen Browne said:
mazer77 said:
How do I make a field a required input based on the value of another
field?
if the value of the other field is "0" then the input field is not
required.

Open the table in design view.

Open the Properties box.

Beside the Validation Rule in the properties box, enter:
([Field1] Is Null) OR ([Field2] Is Not Null)
substituting the names of your fields.

Be sure to use the Validation Rule in the properties (i.e. the one for
the
table), not the one in the lower pane of table design window (which is
the
rule for a field.)

Here's a bunch of validation rules:
http://allenbrowne.com/ValidationRule.html
 
Top