I don't understand how you want to assign this value in a query.
Your table has 2 fields: Dept_NBR, and Class_NBR.
If Dept_NBR is 28, ClassNBR should be restricted to 7, 20, or 22.
If Dept_NBR is not 28, ClassNBR should be Null.
There is no clear way to decide which of the 3 values to use when Dept_NBR
is 28. We also don't know when or why there could be invalid entries in
Class_NBR, and whether you want to destroy those values, suppress them,
prevent them in the first place, or ...
To prevent them, you could use a validation rule on your table:
1. Open the table in design view.
2. Open the Properties sheet.
3. Beside the Validation Rule in the Properties sheet, enter something like
this:
(([Dept_NBR = 28) AND ([Class_NBR] IN (7, 20, 22)) OR [Class_NBR] Is Null
Be sure you use the Validation Rule in the Properties sheet (the one for the
table), not the one in the lower pane of table design (which is the rule for
a field.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
Kerry said:
Hi! I've got the following fields and I want the second to contain
criteria
contingent on the value of the first:
Dept_NBR is a number coming from a form selection of multiple #s and if it
is 28, I want Class_NBR to be 7 or 20 or 22. If Dept_NBR is not 28, I
want
the Class_NBR criteria to be null.
Not sure where to start with this...any help is appreciated!!