Make a field NotNull based on a contion in another field

  • Thread starter Beverly Darvill
  • Start date
B

Beverly Darvill

Hi

I have a form that comes from a query of the same name (Project Review
Actions Closure Query (yes with spaces - not my choice) and within that form
I have a drop down list on a field called Status that allows the user to
select either Open Or Closed. If the Status is set to Closed then I need to
force the user to enter a date in the field (Date Closed (again with
spaces)). How can I force the user to do this and how can I get around the
fact that the form and the field have been set up with spaces without me
having to rename everything.

Thanks
 
A

Allen Browne

Open the table in design view.

Beside the Validation Rule in the Properties sheet (not in the lower pane of
table design!), enter:
([Status] Is Null) OR ([Status] <> "Closed") OR ([Date Closed] Is Not
Null)

For an explanation, see:
Validation Rules
at:
http://allenbrowne.com/ValidationRule.html
 
B

Beverly Darvill

I entered this in the place you said and it still lets me save and exit the
form without telling I have to enter a date.

Allen Browne said:
Open the table in design view.

Beside the Validation Rule in the Properties sheet (not in the lower pane of
table design!), enter:
([Status] Is Null) OR ([Status] <> "Closed") OR ([Date Closed] Is Not
Null)

For an explanation, see:
Validation Rules
at:
http://allenbrowne.com/ValidationRule.html

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

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

Beverly Darvill said:
I have a form that comes from a query of the same name (Project Review
Actions Closure Query (yes with spaces - not my choice) and within that
form
I have a drop down list on a field called Status that allows the user to
select either Open Or Closed. If the Status is set to Closed then I need
to
force the user to enter a date in the field (Date Closed (again with
spaces)). How can I force the user to do this and how can I get around
the
fact that the form and the field have been set up with spaces without me
having to rename everything.
 
A

Allen Browne

Something was wrong, then, Beverly.

Are these controls bound to fields?
Did you choose the right table?
Is the Validation Rule still there when you open the table and look again?
Did you use the rule for the Table, not the rule for a field?
Other mistake?

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

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

Beverly Darvill said:
I entered this in the place you said and it still lets me save and exit the
form without telling I have to enter a date.

Allen Browne said:
Open the table in design view.

Beside the Validation Rule in the Properties sheet (not in the lower pane
of
table design!), enter:
([Status] Is Null) OR ([Status] <> "Closed") OR ([Date Closed] Is Not
Null)

For an explanation, see:
Validation Rules
at:
http://allenbrowne.com/ValidationRule.html

Beverly Darvill said:
I have a form that comes from a query of the same name (Project Review
Actions Closure Query (yes with spaces - not my choice) and within that
form
I have a drop down list on a field called Status that allows the user
to
select either Open Or Closed. If the Status is set to Closed then I
need
to
force the user to enter a date in the field (Date Closed (again with
spaces)). How can I force the user to do this and how can I get around
the
fact that the form and the field have been set up with spaces without
me
having to rename everything.
 

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

Top