A field value dependant on which table another field value is in

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I have the value of a field depend upon which table the value of
another field can be found in?

e.g. Table 1: [field 1 if value of field 2 is in table 2, then = 2, if 3,
then = 3] [field 2= a]

Table 2 has a, b, c,
Table 3 has c, d, e

Field 1 in table 1 would = 2
 
How can I have the value of a field depend upon which table the value of
another field can be found in?

e.g. Table 1: [field 1 if value of field 2 is in table 2, then = 2, if 3,
then = 3] [field 2= a]

Table 2 has a, b, c,
Table 3 has c, d, e

Field 1 in table 1 would = 2

I'd STRONGLY suggest that you *stop*, step back, and reconsider your
table design. The mere need to ask this question suggests that your
tables are not properly normalized, and that you're storing data in
table names. Could you explain what these Table2 and Table3 represent?

There would be *no* easy way to do this automatically; you would need
some fairly complex queries or VBA code, and the value you stored in
Table1 would immediately be wrong if either other table were updated.
For that matter, what would the Table1 field contain if *both* Table2
and Table3 contained a?

John W. Vinson[MVP]
 
Back
Top