1 field input required only if a value appears in another

  • Thread starter Thread starter mazer77
  • Start date Start date
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.
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top