table relation

aripp

New member
Local time
Yesterday, 22:30
Joined
Aug 23, 2014
Messages
5
hi everyone
that's my first question in here and as you know only first step is hard ,,:)
guys i wanna explain my project before ask a question to not be complicated,
table1 table2
____ ______
| | | | | |
| | | | | |

so i want {1field of table2} be result of {fild1 + filed2}of 1 table

hope get answer
 
Your question is way too vague. Do you want to concatenate two fields and store them as one field in the second table? Or do you want to select a record in one table by doing a join to fields in a second table? Or something else?
 
in first thanks ,
sorry if my question is not clear
here may i can explain more,,,
the first table has 2 field and each field contain different number
and what i want is how i could make first filed of second table be result
of sum of first two table ,,
for example
tabel1 >>>>>> table2
field1 /filed2>>>> field1
3 ||| 3 >>>>> [6]
5 ||| 10 >>>>> [15]

i put those |> just to make shape of it ,
thanks
 
Last edited:
Depending on what you are wanting to do several things might work.

Assuming Table1 has an Primary Key lngPriKey, and Table2 has lngPriKey2

Code:
UPDATE Table1 INNER JOIN Table2 ON Table1.lngPriKey = Table2.lngPriKey2 SET Table2.SumsFromTable1 = [table1].[FirstField]+[table1].[SecondField];
Or an Insert Query:
Code:
INSERT INTO table2 ( SumsFromTable1 )
SELECT Table1.[FirstField]+[SecondField] AS Expr1
FROM Table1;
Or you could create a form based on a query that joins Table1 and Table2 and do the calculation in an AfterUpdate event, or where ever.
Code:
...
me!SumsFromTable1 = me!FirstField + Me!SecondField
...
But WHY are you saving a calculated value? Database Normalization rules frown on such things. If you need the sum, calculate it in a select query.
 
thank u guys so much u answer was so helpful "Royce"
i made calculate with Query it was easy,,but
my plan was to make inventory database ,,
and the idea was so sample but when it come to creation it became complicated ,, so may anyone of u have a idea ,, the main idea is
i have store and from this store many shop took stuff so the data i want was to know in which day they took it and how many they took and how many left in store ,,,

sorry my question get so far
 

Users who are viewing this thread

Back
Top Bottom