2016-12-14 75 views
0

如果我有以下2個表,我想更新[Tbl1]![B]的值將兩個表格之間的字段「A」鏈接在一起,然後查找「B」的值Tbl2, Access究竟如何確定將哪個值選擇爲B?當查詢表有多個匹配項時,通過連接2個表中的字段來更新MS Access

TBL1

+------+------+ 
| A | B | 
+------+------+ 
| 111 | ? | 
| 222 | ? | 
+------+------+ 

TBL2

+------+------+ 
| A | B | 
+------+------+ 
| 111 | AAA | 
| 111 | BBB | 
| 222 | CCC | 
| 222 | DDD | 
+------+------+ 

回答

0

我想你想有一個查找表主表。如果是這樣,這就是你如何做的,這樣當你更新查找表時,主表中的所有值都會更新。

Go to design view for the Main Table(tbl2) 
Go to the field(A) that will be linked to the lookup table. 
The data type for this field should be number. 
Click on the tab "Lookup". 
Change [Display Control] to "Combo Box" 
Set [Row Source Type] to "Table/Query" 
Set [Row Source] = "SELECT A, B From TBL1" 
Set [Column Count] = 2 
Set [Column Widths] = 0;10