compair two tables and call a value

  • Thread starter Thread starter supercool
  • Start date Start date
S

supercool

Hello Friends,
i am new to this forum i have a problem,
i have 2 tables table1 and table 2

table1 is like this and already having records as shown below
[age][term][value]
15 11 32.6
15 12 31.6
16 11 25.3
16 12 22.5
17 11 26.3

and other table2 is same with fields [age1][term1][value1] with no records in
it i want to do that if i entering value in table2 age and term i want value
automatically in that field i;e; if [age]=[age1]&[term]=[term1] then i want
automatic display of [valu]=[value1] means if i am entering [age1]=15 and
[term1]=11 i want automatic
display and store of 32.6 in [value1] automatically. and i want to display
same procedure in form also.. plz help me for this problem
 
Your problem is poor table design. You should not be storing the same data
in two different places. Do a little research on data normalization.

HTH;

Amy
 
Sorry, but it makes no sense at all to have the same data duplicated in
multiple tables.

It sounds as though Age and Term together comprise the Primary Key of
table1. That means you should only be storing Age and Term in table2, not
value. You can join the two tables together in a query whenever you require
value in conjunction with table2.
 
Perhaps if you explain "why" you are trying to store the data in two tables...

You already have the data in table1 so why not use your form to automatically
display [value] when you have entered [age] and [item]. Essentially, that's
what you want to do with table2 anyway.... you are making things more
difficult for yourself.

My gut feeling is that you have not laid out your table structure properly to
begin with. (normalization - as noted in the first response you received)
Hello Friends,
i am new to this forum i have a problem,
i have 2 tables table1 and table 2

table1 is like this and already having records as shown below
[age][term][value]
15 11 32.6
15 12 31.6
16 11 25.3
16 12 22.5
17 11 26.3

and other table2 is same with fields [age1][term1][value1] with no records in
it i want to do that if i entering value in table2 age and term i want value
automatically in that field i;e; if [age]=[age1]&[term]=[term1] then i want
automatic display of [valu]=[value1] means if i am entering [age1]=15 and
[term1]=11 i want automatic
display and store of 32.6 in [value1] automatically. and i want to display
same procedure in form also.. plz help me for this problem
 
Back
Top