Create a constraint in a field depending of another field
<p>I have a table <code>T1</code> with three field: </p>

<ul>
<li><code>id</code> integer </li>
<li><code>Vocation</code> integer : <code>VOCATION</code> = 1 or 2 or 3 or 4 or 5 </li>
<li><code>TYPE</code> integer : <code>TYPE</code> = 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8</li>
</ul>

<p><code>TYPE</code> depend on <code>VOCATION</code>. For example if <code>VOCATION = 1</code>, <code>TYPE</code> should be = 2 or 3 or 4 or 6, other example if <code>VOCATION = 2</code>, <code>TYPE</code> should be = 4 or 5, etc.</p>

<p>I would create a constraint in <code>TYPE</code> that force the value of constraint to be, for example, 4 or 5 if the value of <code>VOCATION</code> is 2, etc.</p>

<p>some idea please</p>

<p>I tried this but it didn't work:</p>

<pre><code>TYPE = contr( !VOCATION!)

def contr(Voc):
    if Voc == 1 :
        return [2, 3, 4, 6]
</code></pre>
