Validation Rules

  • Thread starter Thread starter armymatt
  • Start date Start date
A

armymatt

Hey Ya'll,

I'd like to thank ya'll for your help up front. Here is my dilema. I want
to create a validation rule for one of my tables. Two of my Fields are:


Status
Date

I have it set up so you can choose from a list box for the "Status" field.
I'm trying to make it so you can only enter a date in the "Date" field if
"complete" is selected in the "Status" field.

I am not new to Access but I haven't used it for some time and I'm getting
back into it. Is my problem fixible with out much of a hassle? Again, thank
you for the help
 
That sounds like a table design problem rather than a vba problem, isn't it?

Open the table in design view, have the Table Properties Sheet open.

In Validation Rule, type:

(NOT DateFieldNameHere IS NULL) IMP (Status = "Complete")


and, for Validation Text, type:

Cannot supply a date if the status is not marked as "Complete"



Table validation rules can be used to described a condition that must exists
between fields of the same RECORD.

IMP is a Jet defined Boolean operator and stands for IMPLIES which always
return TRUE unless the left argument is true and the right argument is not
true.




Vanderghast, Access MVP
 
Michel Walsh said:
That sounds like a table design problem rather than a vba problem, isn't
it?

Open the table in design view, have the Table Properties Sheet open.

In Validation Rule, type:

(NOT DateFieldNameHere IS NULL) IMP (Status = "Complete")


and, for Validation Text, type:

Cannot supply a date if the status is not marked as "Complete"



Table validation rules can be used to described a condition that must
exists between fields of the same RECORD.

IMP is a Jet defined Boolean operator and stands for IMPLIES which always
return TRUE unless the left argument is true and the right argument is not
true.


Great use of an obscure operator, Michel! If I hadn't taken a course in
symbolic logic in college, I'd never have understood the Imp operator.
 
Back
Top