set default value of field the value of other table field value

Yero

New member
Local time
Today, 07:17
Joined
Sep 11, 2011
Messages
2
Hi
I have a little problem with defination of default value
I have two tables "Arcive" and "Input" Archive have the following fields F1 and F2
Input have val5 and val7

here is table Input
val7 val5
CI/003137 , AAA
CI/003138 , BBB
CI/003139 , CCC
CI/003143 , DDD
CI/003145 , EEE
CI/003148 , FFF
CI/003128 , JJJ
CI/003131 , HHH
CI/003132

And here is table Archive
F1 F2
CI/003137 , AAA
CI/003138 , BBB
CI/003139 , CCC
CI/003143 , DDD
CI/003145 , EEE
CI/003148 , FFF
CI/003128 , JJJ
CI/003131 , HHH
CI/003132 , MMM

I don't use forms. Archive and Input have relationship Archive.F1=input.val7
The values F1 F2 and val7 inserted into tables manualy through access datasheet .
I need that when I insert new values the val5 takes the value from Archive.F2 field
automatic.
How can I do it?
In example I insert last record in Archive F1=CI/003132 F2=MMM
Input.val7=CI/003132 as I said I need that Input.val5 get it's value from Archive.F2
In this case it must be MMM

Please Help
Best Regards
 
Why have two tables with the same data ?

If you were using a Form, you could have an After Update Event to Update the value from one table to the other but just using Data sheet ??

Access 2010 has Data Macros which are in the Tables and that may do the task you require but as above, why have an Archive Table?

Backup copy of the database provides Archive facility.
 
This is the simple example
In real I have to put in val5 field a value that I get from formula "F2+F_Agents.F2" As you see I need to concat two fields and put them in val5
Also I have couple of fields like these which I get by using some formulas
I thought to use for this (default value) in field properties but when I wrote there
=[Arcive].[F2] it show error "Could not find field 'Archive].[F2' "
 
I can not think of a solution as all my experience relates to a form being used.

DLookup() would work in a form environment but not sure it can be used in a table field.

You could run an action query to put the value of one table into another but again, how to activate the query when you only have tables.

You didn't answer the question of why you need two tables with the same data ?
 

Users who are viewing this thread

Back
Top Bottom