2016-12-14 35 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