将值从查询复制到表单或表(访问)

时间:2021-09-15 23:07:03

My question is, how can I simply copy a count result from a query and show it on a table linked to it... Or directly on a form.

我的问题是,我怎样才能简单地从查询中复制计数结果并将其显示在链接到它的表格上......或者直接在表格上显示。

There is my example:

有我的例子:

**TABLE**
-Name-        -Material-        -Quantity-
Pencil        Drawing            X
Eraser        Drawing            X
Cables        Electronics        X
Camera        Photograph         X

(The "X" equals to the quantity of same material, in this example is 2-Drawing, 1-Electronics and 1-Photograph)

(“X”等于相同材料的数量,在此示例中为2-Drawing,1-Electronics和1-Photograph)

**QUERY**
-Material-    -Material-
 Group By      Count

(This query returns the result of the "X", grouped by "Material" and when running it, the column named as "CountMaterialMath")

(此查询返回“X”的结果,按“材质”分组,运行时,名为“CountMaterialMath”的列)

So what should I do? Make an Expression on my form showing it on a text field (I don't know how to do it), or just copy/call the value someway to the table.

所以我该怎么做?在我的表单上创建一个表达式,在文本字段上显示它(我不知道该怎么做),或者只是将值复制/调用到表中。

Really thanks for your help.

非常感谢你的帮助。

1 个解决方案

#1


0  

If i get this right have you checked DLookup function?

如果我说得对,你检查过DLookup功能吗?

Place a textbox(txtToShow) on to your form and use this

将文本框(txtToShow)放在表单上并使用它

txtToShow = DLookup("[YourTable]" , "Query")

txtToShow = DLookup(“[YourTable]”,“查询”)

Kind Regards, KB

亲切的问候,KB

#1


0  

If i get this right have you checked DLookup function?

如果我说得对,你检查过DLookup功能吗?

Place a textbox(txtToShow) on to your form and use this

将文本框(txtToShow)放在表单上并使用它

txtToShow = DLookup("[YourTable]" , "Query")

txtToShow = DLookup(“[YourTable]”,“查询”)

Kind Regards, KB

亲切的问候,KB